Re: checking date format with postgresql without creating - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: checking date format with postgresql without creating
Date
Msg-id Pine.LNX.4.33L2.0111200253000.18739-100000@aguila.protecne.cl
Whole thread Raw
In response to checking date format with postgresql without creating a table  (Neil Zanella <nzanella@gpu.srv.ualberta.ca>)
Responses Re: checking date format with postgresql without creating  (Neil Zanella <nzanella@gpu.srv.ualberta.ca>)
List pgsql-general
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[@]atentus.com>)


pgsql-general by date:

Previous
From: "Alexis Maldonado"
Date:
Subject: Help with Toast.
Next
From: Mike Castle
Date:
Subject: email time warps