Re: BUG #16088: Multiple foreigh keys created on "ALTER TABLE" command

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #16088: Multiple foreigh keys created on "ALTER TABLE" command
Дата
Msg-id 23525.1572363425@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #16088: Multiple foreigh keys created on "ALTER TABLE" command  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> If you run this command multiple times:

> ALTER TABLE myschema.mytable ADD IF NOT EXISTS mycolumn uuid REFERENCES
> myschema.mytable2(userid);

> It adds the column once, but adds a duplicate FOREIGN KEY each time.

Yeah, this is a well known problem :-(.  The IF NOT EXISTS conditionalizes
addition of the column, but not the quasi-independent addition of the
foreign key constraint.  There's work afoot to make this behave more
intuitively, but it won't land before v13 at the earliest.

            regards, tom lane



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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #16088: Multiple foreigh keys created on "ALTER TABLE" command
Следующее
От: Euler Taveira
Дата:
Сообщение: Re: BUG #16086: Cannot connect using psql, however I can connectusing pgadmin