Re: NULL & NOT NULL - Mailing list pgsql-hackers

From Thomas G. Lockhart
Subject Re: NULL & NOT NULL
Date
Msg-id 36824A47.697E1BB8@alumni.caltech.edu
Whole thread Raw
Responses Re: [HACKERS] Re: NULL & NOT NULL
List pgsql-hackers
> > > I'm trying to "convert" the sample db found in "The Practical SQL
> > > Handbook" Bowman, et al. to postgres.  When trying to create the
> > > following table I get "parser: parse error at or near 'null'"
> > > create table authors (
> > >         zip             char(5)         null
> > > );
> > > The table creation works fine with the NOT NULL but won't work
> > > with the NULL. NULL is supported isn't it?
> > The NULL constraint syntax is *not* supported, since it results in
> > shift/reduce conflicts in our yacc parser. This is because the token
> > is ambiguous with other uses of NULL in the same area, at least as
> > far as yacc is concerned.

Sheesh. After that long song and dance about why we can't implement
this, it turns out that it works fine. We had been trying to implement a
slightly different syntax, "WITH NULL", which conflicted with the
SQL92-defined data type declaration "TIMESTAMP WITH TIME ZONE".

The "Practical SQL Handbook"-compatible form will be available in the
next full release of Postgres. Thanks.

                      - Tom

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] 6.4.1 HISTORY etc.
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Re: NULL & NOT NULL