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

From Thomas G. Lockhart
Subject Re: NULL & NOT NULL
Date
Msg-id 36810E66.1508732E@alumni.caltech.edu
Whole thread Raw
In response to NULL & NOT NULL  (Bill Sneed <bsneed@mint.net>)
List pgsql-general
> 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 twith 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.

However, the default behavior for all columns is to allow NULL values,
so it is a noise word which can be omitted without ill effect.

                      - Tom

pgsql-general by date:

Previous
From: Adriaan Joubert
Date:
Subject: Postgresql on Alpha
Next
From: Adriaan Joubert
Date:
Subject: Re: [GENERAL] Postgres 6.4.1 on DEC-ALPHA