From postgresql-general Thu Apr 10 09:46:55 2008 From: Mario Weilguni Date: Thu, 10 Apr 2008 09:46:55 +0000 To: postgresql-general Subject: Re: [HACKERS] Setting a pre-existing index as a primary key Message-Id: <47FDE20F.7040006 () sime ! com> X-MARC-Message: https://marc.info/?l=postgresql-general&m=120782139514659 Tom Lane schrieb: > "Jonah H. Harris" writes: > >> I've run into a couple cases now where it would be helpful to easily >> assign an already-existing unique index as a primary key. >> > > You need to present a more convincing use-case than this unsupported > assertion. There's hardly any effective difference between a unique > index + NOT NULL constraints and a declared primary key ... so what > did you really need it for? > > In fact it seems to be necessary when connecting with ODBC, I had the problem a month ago, MsSQL will not work correctly with connected tables in a postgres database when there is no PK. NOT NULL and unique index is not enough. But I think it's overkill to add ALTER commands for this rare corner case, maybe it's enough to set "indisprimary" on the index? -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers