Skip site navigation (1) Skip section navigation (2)

Re: Constraint names using 'user namespace'?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Constraint names using 'user namespace'?
Date: 2000-11-28 05:24:01
Message-ID: 13601.975389041@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Philip Warner <pjw(at)rhyme(dot)com(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2000-11-28 05:38:37
Subject: Re: 8192 BLCKSZ ?
Previous:From: Tom LaneDate: 2000-11-28 05:07:49
Subject: Re: [HACKERS] Indexing for geographic objects?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group