Re: [GENERAL] I think this is a BUG?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] I think this is a BUG?
Дата
Msg-id 209.1209054435@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [GENERAL] I think this is a BUG?  ("Brendan Jurd" <direvus@gmail.com>)
Ответы Re: [GENERAL] I think this is a BUG?  ("Brendan Jurd" <direvus@gmail.com>)
Re: [GENERAL] I think this is a BUG?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
"Brendan Jurd" <direvus@gmail.com> writes:
> transformIndexConstraint sets the is_not_null flag on the ColumnDefs
> associated with the primary key.  That works great in a CREATE TABLE
> context, but in ADD COLUMN, when we haven't created the column yet,
> this means that the column is created with attnotnull set to true,
> which tricks DefineIndex into thinking that the column already has a
> NOT NULL constraint.

Huh?  The attnotnull bit *is* the constraint, there is no other
representation.  (There has been talk of making a pg_constraint
entry but it isn't done today.)

I think the bug here is that ADD COLUMN NOT NULL has to fail if
there's not a default expression supplied (except maybe we could
allow it if the table contains no rows).  ISTM we got this right
in the past, wonder why it's not working now ...
        regards, tom lane


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

Предыдущее
От: Decibel!
Дата:
Сообщение: Re: Index AM change proposals, redux
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Proposed patch - psql wraps at window width