Re: Add column if not exists (CINE)

From: Bernd Helmle <mailings(at)oopsware(dot)de>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, Kjell Rune Skaaraas <kjella79(at)yahoo(dot)no>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Add column if not exists (CINE)
Date: 2010-07-23 06:46:15
Message-ID: 4531E96F050DF4546015EE28@[80.156.86.78]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

--On 21. Juli 2010 17:16:13 -0400 Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> I get the same error message from concurrent CREATE TABLE commands
> even without CINE...
>
> S1:
> rhaas=# begin;
> BEGIN
> rhaas=# create table foo (id int);
> CREATE TABLE
>
> S2:
> rhaas=# begin;
> BEGIN
> rhaas=# create table foo (id int);
> <blocks>
>
> S1:
> rhaas=# commit;
> COMMIT
>
> S2:
> ERROR: duplicate key value violates unique constraint
> "pg_type_typname_nsp_index"
> DETAIL: Key (typname, typnamespace)=(foo, 2200) already exists.
>

Funny, never realized that before, but you're right.

> I agree it would be nice to fix this. I'm not sure how hard it is. I
> don't think it's the job of this patch. :-)

Yes, i agree. I would like to mark this patch "Ready for Committer", if
that's okay for you (since you are a committer you might want to commit it
yourself). Given that there's still some discussion in progress, i'm not
sure about it, however. The patch itself looks fine to me and I'm traveling
this weekend, so i don't want to hold it off as long as necessary.

--
Thanks

Bernd

Browse pgsql-hackers by date

  From Date Subject
Next Message Bernd Helmle 2010-07-23 07:23:56 Re: ALTER TABLE...ALTER COLUMN vs inheritance
Previous Message zb 2010-07-23 06:32:56 Re: lock_timeout GUC patch - Review