Re: bug in schema export? - Mailing list pgsql-general

From Tom Lane
Subject Re: bug in schema export?
Date
Msg-id 4588.1176835906@sss.pgh.pa.us
Whole thread Raw
In response to bug in schema export?  (Jonathan Vanasco <postgres@2xlp.com>)
Responses Re: bug in schema export?  (Jonathan Vanasco <postgres@2xlp.com>)
List pgsql-general
Jonathan Vanasco <postgres@2xlp.com> writes:
> i believe i found a bug
>     psql> create table test_failure ( id integer primary key );
>     psql> alter table test_failure alter id rename to id_new ; # not
> relevant, just illustrating the reason how i got to step 2
>     psql> alter table test_failure_pkey rename to test_failure_id_new_pkey;

>     $ pg_dump --schema-only -ttest_failure -Utest > test.sql

> the pkey in the schema is added as 'test_failure_pkey' , not
> 'test_failure_id_new_pkey';

You didn't rename the constraint.  If we were going to do anything about
this, it'd be to forbid directly renaming indexes that're owned by
constraints.  However, since we don't currently have a RENAME CONSTRAINT
command, the effect of that would be that you couldn't do it at all ...

In the meantime you can probably do an UPDATE on pg_constraint if you
really care.

            regards, tom lane

pgsql-general by date:

Previous
From: Jonathan Vanasco
Date:
Subject: bug in schema export?
Next
From: Sven Willenberger
Date:
Subject: Re: postgresql 8.1.4 to 8.2.3