Empty Date Field
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.
Thank you.
Fabian.
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
"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
Thank you very much.
I have another question if you don't mind...
I live in Colombia (Sounth America) and on the currency works with numbers
much higher than the ones used in dollars. For example we work with amounts
greater thar 1 billion pesos, but the field works only if the amounts are
much smaller than that. How can I create another type so I can resolve this
problem.
Thank you again
Fabian
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
Import Notes
Resolved by subject fallback
Set the field to null. i.e.
update foo set datetime=null where...
fabian baena wrote:
Show quoted text
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.Thank you.
Fabian.
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com