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