Renaming unnamed FK constraints - Mailing list pgsql-novice

From Vincent Frison
Subject Renaming unnamed FK constraints
Date
Msg-id 200604170234.56775.turman@ohmforce.com
Whole thread Raw
Responses Re: Renaming unnamed FK constraints  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
Hello,

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..

This is very hapless since unnamed constraints are totally ignored from a lot
of SQL clients (PgAdmin3, TOra, SQuirreL...). The only solution seems to
rename all these constraints but I didn't find how to do it. I see somewhere
in this ML that I should drop all the triggers related to RI (and then
recreate all FKs with "ALTER TABLE" with named constraints). But it looks
like a plodding task isn't it?

Am I the only one who uses "REFERENCES TABLE..." directly into "CREATE TABLE"
statements? Should I go to evil for that? ;)

Thanks.

Vincent.


pgsql-novice by date:

Previous
From: Frank Bax
Date:
Subject: Re: Crontab problem with backup
Next
From: Tom Lane
Date:
Subject: Re: Renaming unnamed FK constraints