Cast '' (blank) to null date

From: "Mattis Jiderhamn" <mattias(at)expertsystem(dot)se>
To: pgsql-sql(at)postgresql(dot)org
Subject: Cast '' (blank) to null date
Date: 2001-07-20 09:44:08
Message-ID: 9j8udq$fmo$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi there everyone.
I'm trying to create a trigger so that, if I try to insert blank, that is
'', into a date field it will be converted to null so that I don't get
ERROR: Bad date external representation ''

I believe my ploblem is that I don't know the type of blank (''), and
therefore do not know what to cast from.
It seems it is not unknown.
Any other suggestions?

Thanks,
Mattias Jiderhamn
mattias(at)expertsystem(dot)se

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Gary Stainburn 2001-07-20 10:22:16 example of [outer] join
Previous Message Gary Stainburn 2001-07-20 09:39:16 multiple lookup per row