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

From Philip Warner
Subject Re: Constraint names using 'user namespace'?
Date
Msg-id 3.0.5.32.20001128164322.00c5a660@mail.rhyme.com.au
Whole thread Raw
In response to Re: Constraint names using 'user namespace'?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Constraint names using 'user namespace'?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
At 00:24 28/11/00 -0500, Tom Lane wrote:
>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.

That would at least be consistent, but it's still using 'user namespace'
for system-related items, which seems like a bad practice if it can be
avoided. I don't mind a longer name, if that is your objection:
pg_constraint_pk1_zzz or some such.

>If we do either, it will break the recently submitted pg_dump patch that

Not too hard to fix.


>uses the index name as the constraint name.  I thought that patch was
>wrongheaded anyway, and would recommend reversing it...

I wasn't too keen on it, but could not come up with any good arguments
against it. We need a unified approach to constraints, but in the mean time
it seems OK. Do you have any more definite objections?




----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 008 659 498)          |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 0500 83 82 82         |                 ___________ |
Http://www.rhyme.com.au          |                /           \|                                |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/


pgsql-hackers by date:

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