Re: primary key and unique index

2018-03-24 Thread Thomas Poty
Many thanks Phil for complementary information . Le sam. 24 mars 2018 à 09:53, HORDER Phil a écrit : > Some databases will create a unique index for you when you create a > primary key. > > Oracle will create one, but only if you haven’t already done that. > > > > Postgres will ALWAYS create a u

RE: primary key and unique index

2018-03-24 Thread HORDER Phil
Some databases will create a unique index for you when you create a primary key. Oracle will create one, but only if you haven’t already done that. Postgres will ALWAYS create a unique index based on the primary key – so you should never do that as well, or the db will have to maintain two identi

Re: primary key and unique index

2018-03-23 Thread Achilleas Mantzios
On 23/03/2018 09:55, Thomas Poty wrote: Hi all, I am migrating fromMySQL to Postgresql 9.6. In MySQL a  "show create table" gives me :  ...   PRIMARY KEY (`ID`,`CountryCode`,`LanguageCode`),   UNIQUE KEY `unique_my table_4` (`ID`,`CountryCode`,`LanguageCode`), ... So, In PostgreSQL, does it ma

Re: primary key and unique index

2018-03-23 Thread David Rowley
On 23 March 2018 at 20:55, Thomas Poty wrote: > In MySQL a "show create table" gives me : > ... > PRIMARY KEY (`ID`,`CountryCode`,`LanguageCode`), > UNIQUE KEY `unique_my table_4` (`ID`,`CountryCode`,`LanguageCode`), > ... > > So, In PostgreSQL, does it make sense to create a primary key AND