Re: BUG #5115: ADD UNIQUE table_constraint with expression
| От | Tom Lane |
|---|---|
| Тема | Re: BUG #5115: ADD UNIQUE table_constraint with expression |
| Дата | |
| Msg-id | 13665.1255533387@sss.pgh.pa.us обсуждение |
| Ответ на | BUG #5115: ADD UNIQUE table_constraint with expression ("Vladimir Kokovic" <vladimir.kokovic@a-asoft.com>) |
| Список | pgsql-bugs |
"Vladimir Kokovic" <vladimir.kokovic@a-asoft.com> writes:
> For ALTER TABLE ADD CONSTRAINT documentation says:
> ADD table_constraint
> This form adds a new constraint to a table using the same syntax as
> CREATE TABLE.
> But if expression is used in the constraint definition
> server says:
> # ALTER TABLE asoft_finansije.gk_promene ADD CONSTRAINT vk2
> UNIQUE((substring(broj,10)),id)
> asoft-# ;
> ERROR: 42601: syntax error at or near "("
> LINE 1: ...ft_finansije.gk_promene ADD CONSTRAINT vk2 UNIQUE((substring...
> ^
Yeah, if you tried writing that in CREATE TABLE, it would complain too.
> Create index is OK:
> *# CREATE UNIQUE INDEX vk2 on
> adefault_finansije.gk_promene((substring(broj,10)),id);
> CREATE INDEX
This is not a CONSTRAINT clause in a CREATE TABLE.
regards, tom lane
В списке pgsql-bugs по дате отправления: