Re: Recreating unique index for primary key - Mailing list pgsql-general

From Tod McQuillin
Subject Re: Recreating unique index for primary key
Date
Msg-id 20010930002004.C11516-100000@glass.pun-pun.prv
Whole thread Raw
In response to Re: Recreating unique index for primary key  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Recreating unique index for primary key
List pgsql-general
On Sat, 29 Sep 2001, Tom Lane wrote:

> CREATE UNIQUE INDEX is fine as far as the database goes.  Offhand it
> looks like the only extra thing a primary-key marker does is to define
> the default reference column for subsequent foreign-key references
> pointing at your table.
>
> If you want, you can reach into pg_index and set the indisprimary field
> after creating the index:

I stand corrected; there *is* something in the index itself which marks it
primary.

I'd guess that since the only time 'REFERENCES' is seen is when creating a
new table (and translated into hard-coded triggers after that), you should
be fine until you create a new table referencing the table whose primary
index you removed.

It's an inconsistency I would not feel comfortable with, so I'm glad I
learned about indisprimary.  Is this documented anywhere?
--
Tod McQuillin




pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Encoding passwords
Next
From: Tod McQuillin
Date:
Subject: Re: Recreating unique index for primary key