Re: add constraint deferrable, syntax error

Поиск
Список
Период
Сортировка
От Andreas Kretschmer
Тема Re: add constraint deferrable, syntax error
Дата
Msg-id 20120111180921.GA16936@tux
обсуждение исходный текст
Ответ на add constraint deferrable, syntax error  ("Gauthier, Dave" <dave.gauthier@intel.com>)
Список pgsql-general
Gauthier, Dave <dave.gauthier@intel.com> wrote:

> Why am I getting this?
>
>
>
> xdb=# alter table templates add constraint manager_uid_is_invalid check
> ((constraint_checker('manager',manager,null,null)) = 'OK') DEFERRABLE ;
>
> ERROR:  syntax error at or near "DEFERRABLE"
>
> LINE 1: ...int_checker('manager',manager,null,null)) = 'OK') DEFERRABLE...

1st, i think, you should it rewrite to:

((constraint_checker('manager',manager,null,null) = 'OK'))


2nd, check-constraints ARE NOT DEFERRABLE !!!


http://www.postgresql.org/docs/current/static/sql-createtable.html says:
Currently, only UNIQUE, PRIMARY KEY, EXCLUDE, and REFERENCES (foreign
key) constraints accept this clause. NOT NULL and CHECK constraints are
not deferrable.


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: Enumeration of tables is very slow in largish database
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: indexes no longer used after shutdown during reindexing