More PostgreSQL conversion fun

From: Nick Wiltshire <nick(at)customdesigns(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: More PostgreSQL conversion fun
Date: 2006-04-08 22:56:52
Message-ID: 200604081656.53081.nick@customdesigns.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

I have a varchar field in a table which contains dates in yyyy-mm-dd format.
The problem is that some have entered invalid dates like 1975-01-00 and I
want to convert it to a date field to avoid this nonsense. Is there a way to
test for failure of a type conversion and insert a NULL on failure?

Thanks,
Nick

Responses

Browse pgsql-general by date

  From Date Subject
Next Message zagman 2006-04-09 00:04:41 Postgresql with Access 97
Previous Message amrit 2006-04-08 22:30:46 Cannot connect Postgresql 8.1 64 bit