CHECK constraint (true) causes dumps with parse errors

Поиск
Список
Период
Сортировка
От Szűcs Gábor
Тема CHECK constraint (true) causes dumps with parse errors
Дата
Msg-id 428D99D7.6030800@gmail.com
обсуждение исходный текст
Ответы Re: CHECK constraint (true) causes dumps with parse errors  (Neil Conway <neilc@samurai.com>)
Список pgsql-bugs
Dear Gurus,

Version: 7.3.3, 7.4.8

I don't know for sure, but something like this happened when dumping our
server from 7.3 to 7.4. Actually, it seems to be a problem in 7.4 (maybe
also in 7.3, but unlikely -- see below, "our original way").

# create table foo (bar int, constraint foobar check (true or bar=1));
CREATE TABLE
# \d foo      Table "public.foo" Column |  Type   | Modifiers
--------+---------+----------- bar    | integer |
Check constraints:    "foobar" CHECK (true OR bar = 1)

# drop table foo;
DROP TABLE
# create table foo (bar int, constraint foobar check (true));
CREATE TABLE
# \d foo      Table "public.foo" Column |  Type   | Modifiers
--------+---------+----------- bar    | integer |
Check constraints:    "foobar" CHECK ()

Yours,
--
G.

---------------- our original way we found the problem:
-- original create command:
CREATE TABLE foo (    bar int,    CONSTRAINT foobar CHECK (true or bar=1)
);

-- 7.3 dump:
CREATE TABLE foo (    bar int,    CONSTRAINT foobar CHECK (true)
);

-- fed to 7.4, then \d
...
Check constraints:    "foobar" CHECK ()
-- note the empty parentheses!

-- mirroring the database caused:
ERROR:  syntax error at or near ")" at character xxx

-- recreated table (actually, readded constraint) to 7.4, then \d
...
Check constraints:    "foobar" CHECK (true OR bar=1)



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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: BUG #1675: very slow work
Следующее
От: Neil Conway
Дата:
Сообщение: Re: CHECK constraint (true) causes dumps with parse errors