Re: Unique constraint on field inside composite type.

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Unique constraint on field inside composite type.
Дата
Msg-id CAKFQuwbthE-o_Gdk9vdR+m9N1C=D2E+H4i4HWdrSQtS12QsPfA@mail.gmail.com
обсуждение исходный текст
Ответ на Unique constraint on field inside composite type.  (Silk Parrot <silkparrot@gmail.com>)
Список pgsql-general
On Thu, Aug 18, 2016 at 2:02 AM, Silk Parrot <silkparrot@gmail.com> wrote:

However, the above create table query reports syntax error:

ERROR:  syntax error at or near "."
LINE 10:     UNIQUE (google_user.email)

Is there a way to create unique constraint on a field inside composite type?

​Not tested here but in most (all?) cases when attempting to de-reference a component of a composite typed column you must place the column name within parentheses.

(google_user).email

Otherwise the system is thinking that "google_user" is a schema and email is a column.

David J.​
 

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

Предыдущее
От: Павел Филонов
Дата:
Сообщение: Why insertion throughput can be reduced with an increase of batch size?
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: Why insertion throughput can be reduced with an increase of batch size?