Re: Setting a pre-existing index as a primary key

From: Mario Weilguni <mweilguni(at)sime(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Setting a pre-existing index as a primary key
Date: 2008-04-10 09:46:55
Message-ID: 47FDE20F.7040006@sime.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane schrieb:
> "Jonah H. Harris" <jonah(dot)harris(at)gmail(dot)com> 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?

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Burdairon 2008-04-10 09:47:36 Re: Re: [HACKERS] How embarrassing: optimization of a one-shot query doesn't work
Previous Message Stefan Kaltenbrunner 2008-04-10 09:33:11 Re: Commit fest queue