Re: NULL & NOT NULL

From: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
To: bsneed(at)mint(dot)net
Cc: pgsql-general(at)hub(dot)org
Subject: Re: NULL & NOT NULL
Date: 1998-12-23 15:38:14
Message-ID: 36810E66.1508732E@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general 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 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adriaan Joubert 1998-12-23 18:20:36 Re: [GENERAL] Postgres 6.4.1 on DEC-ALPHA
Previous Message Adriaan Joubert 1998-12-23 10:19:34 Postgresql on Alpha

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas G. Lockhart 1998-12-23 16:14:58 Mhonarc for the docs list
Previous Message Oleg Broytmann 1998-12-23 15:33:14 Re: [HACKERS] Date/time on glibc2 linux