Re: Renaming unnamed FK constraints

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vincent Frison <turman(at)ohmforce(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Renaming unnamed FK constraints
Date: 2006-04-17 16:12:52
Message-ID: 1722.1145290372@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Vincent Frison <turman(at)ohmforce(dot)com> writes:
> Yes this is right on my current PG installation (7.4 on production server, 7.5

7.5? There is no PG 7.5.

> on my dev environnement): unnamed constraints are automaticely named with $1,
> $2, $3.. But it looks like it was not the case with ealier version isn't it?
> I say that because most of my tables was created 2 or 3 years ago (I don't
> remember exactly on which PG versions). For this old tables, I type "\d
> mytable" with psql there's no foreign-key constraints but only triggers
> related to referential integrity.

Yeah, before about 7.3 there was no pg_constraint catalog and thus no
explicit representation of a foreign key constraint at all. I believe
that if you've just propagated a pre-7.3 schema forward via dump and
reload, you'll still have only the triggers and not any explicit
representation of the foreign key. This has nothing to do with the
syntax you used, though.

My recommendation would be to drop all those old triggers and re-create
the foreign key constraints. You could try contrib/adddepend instead of
doing this by hand.

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Vincent Frison 2006-04-17 16:32:35 Re: Renaming unnamed FK constraints
Previous Message Mike 2006-04-17 15:27:48 Re: PostgreSQL a slow DB?