From: Alexander M. Pravking <fduch@antar.bryansk.ru>
To: Iain <iain@mst.co.jp>
Cc: Karel Zak <zakkr@zf.jcu.cz>
Cc: Christoph Haller <ch@rodos.fzk.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: Validity check in to_date?
Date: Tue, 2 Dec 2003 13:55:06 +0300
Message-ID: <20031202105506.GI87728@dyatel.antar.bryansk.ru> (raw)
In-Reply-To: <005201c3b8c1$52374a60$7201a8c0@mst1x5r347kymb>
References: <20031127141125.GC87728@dyatel.antar.bryansk.ru>
<200312020927.KAA17321@rodos>
<20031202095713.GB17884@zf.jcu.cz>
<005201c3b8c1$52374a60$7201a8c0@mst1x5r347kymb>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: fduch@antar.bryansk.ru, iain@mst.co.jp, zakkr@zf.jcu.cz, ch@rodos.fzk.de
Subject: Re: Validity check in to_date?
In-Reply-To: <20031202105506.GI87728@dyatel.antar.bryansk.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox