Re: Weird message when creating PK constraint named like table - Mailing list pgsql-bugs

From Thomas Kellerer
Subject Re: Weird message when creating PK constraint named like table
Date
Msg-id jemo3n$eab$1@dough.gmane.org
Whole thread Raw
In response to Re: Weird message when creating PK constraint named like table  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-bugs
Kevin Grittner, 11.01.2012 21:16:
>> When I do this
>>
>> CREATE TABLE "*T1*"
>> (
>>    "T1_ID" bigint NOT NULL,
>>    CONSTRAINT "*T1*" PRIMARY KEY ("T1_ID" )
>> );
>>
>>
>> I get the following message:
>>
>> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
>> "T1" for table "T1"
>> ERROR:  relation "T1" already exists
>
>> SQL state: 42P07
>
> Hmm.  If I create them with the asterisks as part of the relation
> names, I see the asterisks in the messages:
>
> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
> "*T1*" for table "*T1*"
> ERROR:  relation "*T1*" already exists
>

The * around the table name was added by the translation from the HTML to a plain text email.

If you display the HTML version of the original posting the name is written in bold, and I gues the plain text
"converter"simply adds the asterisks as that is the usual convention for bold in plain text emails. 

The original SQL is:

     CREATE TABLE "T1"
     (
       "T1_ID" bigint NOT NULL,
       CONSTRAINT "T1" PRIMARY KEY ("T1_ID" )
     );

pgsql-bugs by date:

Previous
From: Pavel Golub
Date:
Subject: Re: Weird message when creating PK constraint named like table
Next
From: franco.ricci@phys.uniroma1.it
Date:
Subject: BUG #6395: Invalid XPath expression