Re: Validity check in to_date? - Mailing list pgsql-sql

From Alexander M. Pravking
Subject Re: Validity check in to_date?
Date
Msg-id 20031202105506.GI87728@dyatel.antar.bryansk.ru
Whole thread Raw
In response to Re: Validity check in to_date?  ("Iain" <iain@mst.co.jp>)
Responses Re: Validity check in to_date?
List pgsql-sql
On Tue, Dec 02, 2003 at 07:44:54PM +0900, Iain wrote:
> T've been following this thread with interest because I have a related
> problem. Basically we are storing dates in CHAR fields with al the
> associated problems. I'd like to do it, but changing everything to date
> fields isn't practical for now, so as a stopgap solution, I want to provide
> some validation at the database level.
> 
> I tried:
> 
> create domain ymdtest2 as char(10)   constraint valid_date check
> (VALUE::DATE);

There's no conversion function from char(n) to date, but there's one
from text to date. Try using check (VALUE::text::date).


-- 
Fduch M. Pravking


pgsql-sql by date:

Previous
From: "Iain"
Date:
Subject: Re: Validity check in to_date?
Next
From: "Alexander M. Pravking"
Date:
Subject: Re: Validity check in to_date?