ADD CHECK fails for parent table if column used in CHECK is fully-qualified

Поиск
Список
Период
Сортировка
От Manuel Rigger
Тема ADD CHECK fails for parent table if column used in CHECK is fully-qualified
Дата
Msg-id CA+u7OA6Zs6bZmuakbLv4=7VBOYpBsyswpb7A3hN=n+KO0_z0pQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: ADD CHECK fails for parent table if column used in CHECK is fully-qualified  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Hi everyone,

Consider the following case:

CREATE TABLE t0(c0 boolean);
CREATE TABLE t1(c0 boolean) INHERITS(t0);
ALTER TABLE t0 ADD CHECK(t0.c0); -- unexpected: ERROR:  missing
FROM-clause entry for table "t0"

Is it expected that this fails? Without a child table, this works as I
would expect. If this is expected, I think that the error message
could be misleading. It seems that the full-qualified c0 column (i.e.,
t0.c0) triggers this, because the following works:

CREATE TABLE t0(c0 boolean);
CREATE TABLE t1(c0 boolean) INHERITS(t0);
ALTER TABLE t0 ADD CHECK(c0); -- no error

Best,
Manuel



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

Предыдущее
От: Manuel Rigger
Дата:
Сообщение: Re: ANALYZE on parent table results in an error "tuple alreadyupdated by self"
Следующее
От: David Raymond
Дата:
Сообщение: RE: BUG #15922: Simple select with multiple exists filters returnsduplicates from a primary key field