Re: Renaming unnamed FK constraints

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Renaming unnamed FK constraints
Дата
Msg-id 1722.1145290372@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Renaming unnamed FK constraints  (Vincent Frison <turman@ohmforce.com>)
Ответы Re: Renaming unnamed FK constraints
Список pgsql-novice
Vincent Frison <turman@ohmforce.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

В списке pgsql-novice по дате отправления:

Предыдущее
От: Mike
Дата:
Сообщение: Re: PostgreSQL a slow DB?
Следующее
От: Vincent Frison
Дата:
Сообщение: Re: Renaming unnamed FK constraints