Re: feature request: create table with unique constraint

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: feature request: create table with unique constraint
Дата
Msg-id 24204.1261089579@sss.pgh.pa.us
обсуждение исходный текст
Ответ на feature request: create table with unique constraint  (<wumpus@z1p.biz>)
Список pgsql-general
<wumpus@z1p.biz> writes:
>   , unique ( a_id , ( case when actual then 0 else id end ) )

> Why can i not define the unique constraint in the
> create table?

The syntax for a unique constraint in CREATE TABLE is defined by the SQL
standard, and it doesn't include expressions.  More than the syntax, a
unique constraint also ought to show up in the information_schema views,
and those don't have the ability to handle expressions.  So we have the
capability, but it's only available via CREATE INDEX which is outside
the standard.

            regards, tom lane

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: pg_dump and ON DELETE CASCADE problem
Следующее
От: Tom Lane
Дата:
Сообщение: Re: alter table performance