Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Tables in DB without Primary Key
icon5.gif  [CDO] Tables in DB without Primary Key [message #1012472] Thu, 21 February 2013 16:12 Go to next message
Marc Gil is currently offline Marc Gil
Messages: 81
Registered: July 2009
Member
Hi,

Anybody (Eike? Very Happy ) knows why the tables of the DB have not any Primary Key? CDO_ID columns is not a good candidate to be a primary key?

Thanks Smile
Marc
Re: [CDO] Tables in DB without Primary Key [message #1012584 is a reply to message #1012472] Thu, 21 February 2013 20:50 Go to previous messageGo to next message
Stefan Winkler is currently offline Stefan Winkler
Messages: 277
Registered: July 2009
Location: Germany
Senior Member
Hi Marc,

which DB are you using?
We are, in fact, using the pair of cdo_id, version as primary key for
most tables. If this is not the case for you, then maybe there's a bug
with one of the DB adapters.

Cheers,
Stefan

Am 21.02.13 17:12, schrieb Marc Gil:
> Hi,
>
> Anybody (Eike? :d ) knows why the tables of the DB have not any Primary
> Key? CDO_ID columns is not a good candidate to be a primary key?
>
> Thanks :)
> Marc
Re: [CDO] Tables in DB without Primary Key [message #1012617 is a reply to message #1012584] Thu, 21 February 2013 22:29 Go to previous messageGo to next message
Marc Gil is currently offline Marc Gil
Messages: 81
Registered: July 2009
Member
Hi Stefan,

I'm using postgreSQL 9.1, and I have not seen any table with a defined Primary key... Maybe it's a bug, I don't tried other databases like mySQL or Derby.

Cheers,
Marc
Re: [CDO] Tables in DB without Primary Key [message #1014321 is a reply to message #1012617] Mon, 25 February 2013 15:30 Go to previous messageGo to next message
Stefan Winkler is currently offline Stefan Winkler
Messages: 277
Registered: July 2009
Location: Germany
Senior Member
Hi Marc,

this seems like a bug in the PostgeSQL DBAdapter.
Please open a Bugzilla for this.

Cheers,
Stefan


Am 21.02.13 23:29, schrieb Marc Gil:
> Hi Stefan,
>
> I'm using postgreSQL 9.1, and I have not seen any table with a defined
> Primary key... Maybe it's a bug, I don't tried other databases like
> mySQL or Derby.
>
> Cheers,
> Marc
Re: [CDO] Tables in DB without Primary Key [message #1014661 is a reply to message #1012617] Tue, 26 February 2013 08:27 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5522
Registered: July 2009
Senior Member
Am 21.02.2013 23:29, schrieb Marc Gil:
> Hi Stefan,
>
> I'm using postgreSQL 9.1, and I have not seen any table with a defined Primary key...
Do you see unique indexes on the ID columns (or ID+version pairs)?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] Tables in DB without Primary Key [message #1048229 is a reply to message #1014661] Wed, 24 April 2013 07:39 Go to previous messageGo to next message
Marc Gil is currently offline Marc Gil
Messages: 81
Registered: July 2009
Member
Hi Eike,

Yes, I see an index in PostgreSQL, but there is no explicit definition for the PK. Nevertheless, in MySQL there appears the PK for any table.

Another question: There exist any possibility to specify (for instance, via the Store) that a unique restriction should be created for a column or a set or columns in a table? Maybe taking into account the Unique restriction in the attribute of the metamodel...

Cheers,
Marc

[Updated on: Wed, 24 April 2013 07:39]

Report message to a moderator

Re: [CDO] Tables in DB without Primary Key [message #1051739 is a reply to message #1048229] Mon, 29 April 2013 07:07 Go to previous message
Eike Stepper is currently offline Eike Stepper
Messages: 5522
Registered: July 2009
Senior Member
Am 24.04.2013 09:39, schrieb Marc Gil:
> Hi Eike,
>
> Yes, I see an index in PostgreSQL, but there is no explicit definition for the PK. Nevertheless, in MySQL there
> appears the PK for any table.
For the first time I was able now to install PostgreSQL 9.2.4 on my Windows box and would like to test with it. Can you
please submit a bugzilla and attach all the infos you've given here. Please also note the exact CDO versions that your
DB was first created with and that it's now being used with.

>
> Another question: There exist any possibility to specify (for instance, via the Store) that a unique restriction
> should be created for a column or a set or columns in a table? Maybe taking into account the Unique restriction in the
> attribute of the metamodel...
No, the DBStore should automatically create unique indexes or primary keys where applicable. And with this fix it does
so now:

401763: Make CDO Server more robust against data dictionary changes
https://bugs.eclipse.org/bugs/show_bug.cgi?id=401763

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Previous Topic:[Databinding] EMF and JFace Master/Detail Databinding going in the wrong direction
Next Topic:[CDO] CDOServer throws "The object is already closed [90007-168]" errors with H2-DB
Goto Forum:
  


Current Time: Tue Sep 16 09:32:24 GMT 2014

Powered by FUDForum. Page generated in 0.02062 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software