Re: checking date format with postgresql without creating

From: Neil Zanella <nzanella(at)gpu(dot)srv(dot)ualberta(dot)ca>
To: Alvaro Herrera <alvherre(at)atentus(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: checking date format with postgresql without creating
Date: 2001-11-24 01:29:58
Message-ID: Pine.A41.4.33.0111231829080.35828-100000@gpu1.srv.ualberta.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Thanks. I notice that this method is not SQL compliant and thus
is not portable to other DBMSs.

Thanks,

Neil

On Tue, 20 Nov 2001, Alvaro Herrera wrote:

> On Mon, 19 Nov 2001, Neil Zanella wrote:
>
> > Hello,
> >
> > I would like to be able to check whether some date is a valid date by
> > asking postgresql? Is this possible?
>
> Sure:
>
> alvherre=> select '28 feb 2001'::date;
> date
> ------------
> 2001-02-28
> (1 row)
>
> alvherre=> select '29 feb 2001'::date;
> ERROR: Bad date external representation '29 feb 2001'
>
> You don't need a table to do it.
>
> --
> Alvaro Herrera (<alvherre[(at)]atentus(dot)com>)
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Francis + Helena Madden 2001-11-24 07:47:55 Problems with createdb in MacOsX.1
Previous Message Antonio Sergio de Mello e Souza 2001-11-24 00:36:42 Re: newbie needs help with postgres internal tables