Re: [GENERAL] Empty Date Field - Mailing list pgsql-general

From Oliver Elphick
Subject Re: [GENERAL] Empty Date Field
Date
Msg-id 199905091838.TAA00474@linda.lfix.co.uk
Whole thread Raw
In response to Empty Date Field  ("fabian baena" <fabbaena@hotmail.com>)
List pgsql-general
"fabian baena" wrote:
  >Hi, could any one tell me how can I tell postgres that a date field I made
  >in a table can be empty.
  >
  >I created a table with a field like that but I didn't tell it "not null" in
  >the declaration, and when I try to fill this table with an empty date it
  >gives me an error.

If you don't mention the field in an update or insert, it will automatically
be null.  You can't fill it with the empty string.  You can specifically
make it null:

insert into tablex (dtfield) values (null);

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
               PGP key from public servers; key ID 32B8FAA1
                 ========================================
     "Therefore, my beloved brethren, be ye stedfast,
      unmoveable, always abounding in the work of the Lord,
      forasmuch as ye know that your labor is not in vain
      in the Lord."      I Corinthians 15:58



pgsql-general by date:

Previous
From: "fabian baena"
Date:
Subject: Empty Date Field
Next
From: "fabian baena"
Date:
Subject: Re: [GENERAL] Empty Date Field