Skip site navigation (1) Skip section navigation (2)

Re: [SQL] Problems with create table continued...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Seth Banks" <seth(at)subimage(dot)com>
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] Problems with create table continued...
Date: 2000-02-28 04:29:19
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
"Seth Banks" <seth(at)subimage(dot)com> writes:
> Anyone see a problem with this code?!
> CREATE TABLE content (
>   content_id  serial,
>   parent_id   int4 NOT NULL,
>   parent_type int4 NOT NULL,
>   author_id   int4 NOT NULL,
>   title       text NOT NULL,
>   url         text NULL,
>   start_date  date NOT NULL,
>   end_date    date NOT NULL,
>   priority    int4 NULL,
>   content     text NULL,
>   source      text NOT NULL
> );
> ERROR:  parser: parse error at or near "null"

NULL is not a valid column constraint according to SQL92.
(Even if it were valid, it'd be redundant.)  Drop that
on those three columns and you'll be fine.

			regards, tom lane

In response to

pgsql-sql by date

Next:From: Ross J. ReedstromDate: 2000-02-28 04:36:25
Subject: Re: [SQL] Problems with create table continued...
Previous:From: Vikrant RathoreDate: 2000-02-28 03:49:39
Subject: SQL query problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group