Re: date default - Mailing list pgsql-novice

From Oliver Elphick
Subject Re: date default
Date
Msg-id 1085652121.23805.4.camel@braydb
Whole thread Raw
In response to date default  (Robert Morgan <robert_@ihug.co.nz>)
List pgsql-novice
On Thu, 2004-05-27 at 05:30, Robert Morgan wrote:
> I'm updating a table that has a field which is datatype 'date' this
> field maybe filled out or not before update. If the field  is left blank
> I get an error, if I test to see if the field is empty and if it is, set
> the value to 0001/01/01 then postgres will accept this. I would rather
> the field remained empty but setting the field to 'null' is not accepted
> by postgres. Im using php to test and set the value.

An empty string is not the same as null; what command is PHP sending to
the backend?

If the date column is mentioned, the value inserted for it must be NULL,
not ''.  If that is already the case, make sure the column has not been
declared with a NOT NULL constraint.

Oliver Elphick


pgsql-novice by date:

Previous
From: Robert Morgan
Date:
Subject: date default
Next
From: Robert Morgan
Date:
Subject: Date