Re: Unique constraint on field inside composite type. - Mailing list pgsql-general

From David G. Johnston
Subject Re: Unique constraint on field inside composite type.
Date
Msg-id CAKFQuwbthE-o_Gdk9vdR+m9N1C=D2E+H4i4HWdrSQtS12QsPfA@mail.gmail.com
Whole thread Raw
In response to Unique constraint on field inside composite type.  (Silk Parrot <silkparrot@gmail.com>)
List 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 by date:

Previous
From: Павел Филонов
Date:
Subject: Why insertion throughput can be reduced with an increase of batch size?
Next
From: Jeff Janes
Date:
Subject: Re: Why insertion throughput can be reduced with an increase of batch size?