Re: BUG #2299: pg_dump error w/ renamed primary keys - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #2299: pg_dump error w/ renamed primary keys
Date
Msg-id 27850.1141511785@sss.pgh.pa.us
Whole thread Raw
In response to BUG #2299: pg_dump error w/ renamed primary keys  ("Gavin Scott" <gavin@planetacetech.com>)
List pgsql-bugs
"Gavin Scott" <gavin@planetacetech.com> writes:
> If you rename a primary key, pg_dump tries to recreate it with the original
> name.  Here is how to recreate:

>> CREATE TABLE foo ( id integer );
>> ALTER TABLE foo ADD CONSTRAINT foo_pkey PRIMARY KEY (id);
>> ALTER TABLE foo_pkey RENAME TO bar_pkey;

This is correct, as the controlling name is that of the constraint not
the index.  We really should forbid the above entirely, but it's not
a very high-priority issue.

(Somewhat higher priority is to add a RENAME CONSTRAINT capability;
that's on the TODO list.  There was a patch for this submitted recently
but it needs work...)

            regards, tom lane

pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: BUG #2300: Error in upper function
Next
From: Stephan Szabo
Date:
Subject: Re: BUG #2292: Calling conventions in docs