Re: date default

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Robert Morgan <robert_(at)ihug(dot)co(dot)nz>
Cc: postgres <pgsql-novice(at)postgresql(dot)org>
Subject: Re: date default
Date: 2004-05-27 10:02:01
Message-ID: 1085652121.23805.4.camel@braydb
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Iandé Coutinho 2004-05-27 18:19:35 Distributed db
Previous Message Robert Morgan 2004-05-27 04:30:39 date default