Re: Renaming unnamed FK constraints - Mailing list pgsql-novice

From Tom Lane
Subject Re: Renaming unnamed FK constraints
Date
Msg-id 20206.1145238212@sss.pgh.pa.us
Whole thread Raw
In response to Renaming unnamed FK constraints  (Vincent Frison <turman@ohmforce.com>)
Responses Re: Renaming unnamed FK constraints  (Vincent Frison <turman@ohmforce.com>)
List pgsql-novice
Vincent Frison <turman@ohmforce.com> writes:
> I've created my referential integrity with "REFERENCES TABLE..." directly
> into "CREATE TABLE" statements. I don't have used "ALTER TABLE" with "ADD
> CONSTRAINT constraint_name..." so I have only unnamed constraint for all my
> FKs. Maybe I has been to much lazy..

There's no such thing as an unnamed constraint ... PG would have
generated names for them.  If you're using an old PG version, the
names might look ugly (like "$1"), but they're there.

> This is very hapless since unnamed constraints are totally ignored
> from a lot of SQL clients (PgAdmin3, TOra, SQuirreL...).

Perhaps a name like "$1" would confuse some of those clients, but I
hardly believe it for PgAdmin.  What problem are you seeing *exactly*?

            regards, tom lane

pgsql-novice by date:

Previous
From: Vincent Frison
Date:
Subject: Renaming unnamed FK constraints
Next
From: "Winson Yung"
Date:
Subject: Re: how to encrypt trigger function