Re: Constraint names using 'user namespace'? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Constraint names using 'user namespace'?
Date
Msg-id 13601.975389041@sss.pgh.pa.us
Whole thread Raw
In response to Constraint names using 'user namespace'?  (Philip Warner <pjw@rhyme.com.au>)
Responses Re: Constraint names using 'user namespace'?
List pgsql-hackers
Philip Warner <pjw@rhyme.com.au> writes:
> Just noticed this:

> pjw=# create table pk1(f1 integer, constraint zzz primary key(f1));
> NOTICE:  CREATE TABLE/PRIMARY KEY will create implicit index 'zzz' for
> table 'pk1'
> CREATE
> pjw=# create table zzz(f1 integer);
> ERROR:  Relation 'zzz' already exists

> Is there a good reason why the automatically created items do not have a
> 'pg_' in front of their names?

Not a good idea.  I think it should probably be pk1_zzz in this case.

If we do either, it will break the recently submitted pg_dump patch that
uses the index name as the constraint name.  I thought that patch was
wrongheaded anyway, and would recommend reversing it...
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Mitch Vincent"
Date:
Subject: Re: Full text Indexing -out of contrib and into main..
Next
From: Tom Lane
Date:
Subject: Re: 8192 BLCKSZ ?