Re: BUG #15670: alter table .. add column if not exists ... references ...; adds a FK constraint on each execution

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #15670: alter table .. add column if not exists ... references ...; adds a FK constraint on each execution
Дата
Msg-id 18788.1551798880@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #15670: alter table .. add column if not exists ... references ...; adds a FK constraint on each execution  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> I don't know if this is the expected behavior but when I execute this
> script:
> alter table test2 add column if not exists test1_fk integer not null
> references test1(id);
> alter table test2 add column if not exists test1_fk integer not null
> references test1(id);
> alter table test2 add column if not exists test1_fk integer not null
> references test1(id);
> I end up with 3 FK constrains:

Yeah, this is the same problem previously reported at bug #15180,

https://www.postgresql.org/message-id/flat/152509815280.19803.16118194452213577808%40wrigleys.postgresql.org

We had a sketch for a fix but discussion seems to have trailed off :-(

            regards, tom lane


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

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: BUG #15668: Server crash in transformPartitionRangeBounds
Следующее
От: Amit Langote
Дата:
Сообщение: Re: BUG #15670: alter table .. add column if not exists ...references ...; adds a FK constraint on each execution