Search Postgresql Archives

Re: Unique constraint on field inside composite type.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 18, 2016 at 2:02 AM, Silk Parrot <silkparrot@xxxxxxxxx> 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.​
 


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux