Re: [GENERAL] Empty Date Field

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: "fabian baena" <fabbaena(at)hotmail(dot)com>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Empty Date Field
Date: 1999-05-09 18:38:07
Message-ID: 199905091838.TAA00474@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)Elphick(at)lfix(dot)co(dot)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

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 1999-05-09 20:09:02 Re: [GENERAL] Comments on columns?
Previous Message fabian baena 1999-05-09 17:49:36 Re: [GENERAL] Empty Date Field