Re: check date validity

From: Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com>
To: wlxyk(at)vip(dot)163(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: check date validity
Date: 2004-01-16 14:57:15
Message-ID: 20040116145715.61657.qmail@web20811.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

--- Harald Fuchs <hf99(at)protecting(dot)net> wrote:
> In article
> <20040116054046(dot)E4E751C173283(at)smtp(dot)vip(dot)163(dot)com>,
> "LitelWang" <wlxyk(at)vip(dot)163(dot)com> writes:
>
> > I need this function :
> > CheckDate('2002-02-29') return false
> > CheckDate('2002-02-28') return true
>
> Why would you want to do that? Just try to insert
> '2002-02-29' into
> your DATE column, and PostgreSQL will complain.

That will cause the whole transaction to abort, which
is probably not what is wanted.

I don't know any way around this in Postgres. Best to
check this in application code.

__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-01-16 15:02:32 Re: [GENERAL] Bug and/or feature? Complex data types in tables...
Previous Message Ivar 2004-01-16 14:19:17 Re: Creating GUID