Re: null value in date field

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Jeff Deroshia <jeff(at)hal(dot)physast(dot)uga(dot)edu>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: null value in date field
Date: 2003-02-19 20:45:12
Message-ID: 20030219124108.X37141-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Tue, 18 Feb 2003, Jeff Deroshia wrote:

> I have a form that contains optional DATE fields. To enter null
> values, I've tried null, 'null', '', '-', '0', 0, and each time I get
> the following error:
>
> ERROR: Bad numeric input format ''

Are you sure this is on a date field? Date should be giving you
something like (at least in 7.3):
ERROR: Bad date external representation ''

Null works for me...
sszabo=# create table test(a date);
CREATE TABLE
sszabo=# insert into test (a) values (null);
INSERT 4256129 1
sszabo=# insert into test (a) values ('');
ERROR: Bad date external representation ''

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Larry Rosenman 2003-02-19 20:53:08 Re: null value in date field
Previous Message Nigel J. Andrews 2003-02-19 20:44:09 Re: How do I upgrade or coexist PostgreSQL on a Cobalt