Search Postgresql Archives

Re: Constraint: string length must be 32 chars

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

 



On 10/16/2010 12:48 PM, Alexander Farber wrote:
snake=>  create table gps (
id varchar(32) primary key CONSTRAINT id_length char_length(id)=32,
stamp timestamp DEFAULT current_timestamp,
pos point);
ERROR:  syntax error at or near "char_length"
LINE 2: id varchar(32) primary key CONSTRAINT id_length char_length(...

Sorry, any ideas? (I know it's a stupid question)

See the documentation section 5.3.1 Check Constraints. The condition needs to be in parentheses. And in order to name your constraint, you must use the CONSTRAINT variant.

--
Guy Rouillier

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[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