Re: What's wrong about this sql statement?

From: Richard Poole <richard(dot)poole(at)vi(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: What's wrong about this sql statement?
Date: 2001-08-31 15:08:42
Message-ID: 20010831160842.G24593@office.vi.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gowey, Geoffrey 2001-08-31 15:18:34 Re: speed of communication and pgsql development
Previous Message wsheldah 2001-08-31 15:01:56 Re: Apache authentication