pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Problems with create table continued...
3+ messages / 3 participants
[nested] [flat]

* Problems with create table continued...
@ 2000-02-28 03:35  Seth Banks <seth@subimage.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Seth Banks @ 2000-02-28 03:35 UTC (permalink / raw)
  To: pgsql-sql

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"



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [SQL] Problems with create table continued...
@ 2000-02-28 04:29  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Seth Banks <seth@subimage.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2000-02-28 04:29 UTC (permalink / raw)
  To: Seth Banks <seth@subimage.com>; +Cc: pgsql-sql

"Seth Banks" <seth@subimage.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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [SQL] Problems with create table continued...
@ 2000-02-28 04:36  Ross J. Reedstrom <reedstrm@wallace.ece.rice.edu>
  parent: Seth Banks <seth@subimage.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Ross J. Reedstrom @ 2000-02-28 04:36 UTC (permalink / raw)
  To: Seth Banks <seth@subimage.com>; +Cc: pgsql-sql

On Sun, Feb 27, 2000 at 07:35:13PM -0800, Seth Banks wrote:
> Anyone see a problem with this code?!

Yep - declaring a constaint of "NULL" is not standards compliant SQL: allowing
a column to be null _is_ the default in the standard. Just delete the NULL
from url, priority and content, and you should be fine.

Ross
-- 
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005

> 
> 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"
> 
> ************
> 



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2000-02-28 04:36 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-02-28 03:35 Problems with create table continued... Seth Banks <seth@subimage.com>
2000-02-28 04:29 ` Tom Lane <tgl@sss.pgh.pa.us>
2000-02-28 04:36 ` Ross J. Reedstrom <reedstrm@wallace.ece.rice.edu>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox