Re: Bug with "CHECK" when part of ALTER TABLE ... ADD COLUMN IF NOT EXISTS ... CHECK ...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bug with "CHECK" when part of ALTER TABLE ... ADD COLUMN IF NOT EXISTS ... CHECK ...
Дата
Msg-id 1311.1569356842@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Bug with "CHECK" when part of ALTER TABLE ... ADD COLUMN IF NOTEXISTS ... CHECK ...  ("Alfred R. Fuller" <alfred.fuller@gmail.com>)
Ответы Re: Bug with "CHECK" when part of ALTER TABLE ... ADD COLUMN IF NOTEXISTS ... CHECK ...
Список pgsql-bugs
"Alfred R. Fuller" <alfred.fuller@gmail.com> writes:
> Expected behavior:
> If the column exists nothing is altered.
> Actual behavior:
> The check is always added regardless if the column exists or not.

Yeah, this is yet another variant of the theme that ADD COLUMN IF EXISTS
only conditionalizes the creation of the column proper, and not other
subsidiary subcommands such as adding indexes or constraints.  I've been
poking at a fix [1], and hopefully we'll get it dealt with in v13, but
for sure it'll be a bigger change than we'd risk back-patching.

            regards, tom lane

[1] https://www.postgresql.org/message-id/flat/10365.1558909428@sss.pgh.pa.us



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

Предыдущее
От: Fabrízio de Royes Mello
Дата:
Сообщение: Re: Bug with "CHECK" when part of ALTER TABLE ... ADD COLUMN IF NOTEXISTS ... CHECK ...
Следующее
От: Fabrízio de Royes Mello
Дата:
Сообщение: Re: Bug with "CHECK" when part of ALTER TABLE ... ADD COLUMN IF NOTEXISTS ... CHECK ...