Re: [HACKERS] Re: NULL & NOT NULL - Mailing list pgsql-hackers

From Jose' Soares
Subject Re: [HACKERS] Re: NULL & NOT NULL
Date
Msg-id 368A4355.9C3417AC@sferacarta.com
Whole thread Raw
In response to Re: [HACKERS] Re: NULL & NOT NULL  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
Thomas G. Lockhart wrote:
> 
> > This NULL clause is not part of constraints it is a default option and
> > we already support it,
> > prova=> CREATE TABLE table1 (field1 INTEGER DEFAULT NULL);
> > CREATE
> 
> That is certainly a clearer way of specifying it. Should we forget about
> the other syntax?
> 
>                        - Tom

Imho yes. The syntax CREATE TABLE table (field type NULL) has no sense
the NULL keyword may be used on a DEFAULT clause (if you want to specify
a default value)
or on a column constraint (if you want to avoid data integrity
violation).

1) Column Constraint definition:           [ CONSTRAINT name ] NOT NULL  
2) Default clause:           DEFAULT NULL

-Jose'-


pgsql-hackers by date:

Previous
From: "Thomas G. Lockhart"
Date:
Subject: Re: [HACKERS] problems recovering 6.1 db
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] NUMERIC needs OID's