Re: What's wrong about this sql statement? - Mailing list pgsql-general

From Richard Poole
Subject Re: What's wrong about this sql statement?
Date
Msg-id 20010831160842.G24593@office.vi.net
Whole thread Raw
In response to What's wrong about this sql statement?  ("Corn" <corn@tryit.com>)
List pgsql-general
On Fri, Aug 31, 2001 at 03:58:45PM +0800, Corn wrote:
> I am newbie. Try to create a table like this.
>
> CREATE TABLE usersright (
>     userid INTEGER NOT NULL,
>     rightid INTEGER NOT NULL,
>     allow BOOLEAN NOT NULL DEFAULT FALSE
> CONSTRAINT pk_usersright PRIMARY KEY (userid, rightid)
> );
>
> But I got the following error message:
>
> ERROR: parser: parse error at or near "("
>
> I am following the syntax of SQL statement reference from postgresql web
> site.

Not quite. You need another comma after the FALSE:

CREATE TABLE usersright (
    userid INTEGER NOT NULL,
    rightid INTEGER NOT NULL,
    allow BOOLEAN NOT NULL DEFAULT FALSE,
CONSTRAINT pk_usersright PRIMARY KEY (userid, rightid)
);

Richard

pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: PostgreSQL On the Mac? OS9 or OSX?
Next
From: "Mikheev, Vadim"
Date:
Subject: Re: getting the oid for a new tuple in a BEFORE trigger