Re: Casting timestamp - Mailing list pgsql-sql

From Joel Burton
Subject Re: Casting timestamp
Date
Msg-id JGEPJNMCKODMDHGOBKDNAELLCOAA.joel@joelburton.com
Whole thread Raw
In response to Casting timestamp  ("Edipo E. F. Melo" <edipoelder@ig.com.br>)
Responses Re: Casting timestamp  ("Edipo E. F. Melo" <edipoelder@ig.com.br>)
List pgsql-sql
> -----Original Message-----
> From: pgsql-sql-owner@postgresql.org
> [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Edipo E. F. Melo
> Sent: Saturday, May 18, 2002 7:55 PM
> To: pgsql-sql
> Subject: [SQL] Casting timestamp
>
>
> Hi all,
>
>     I posting this again...
>
>     Why the second casting don't work?
>
> --- start with this
> set datestyle = 'iso';
> show datestyle;
> select current_timestamp::text::timestamp;
> --- now try this
> set datestyle = 'postgres';
> show datestyle;
> select current_timestamp::text::timestamp;
>
>     In the first one, I get
>           timestamptz
> -------------------------------
>  2002-05-13 10:19:55.158434-03
>
>     In the last one, I get
> ERROR:  Bad timestamp external representation 'Mon May 13 10:19:56.671847
> 2002 BRT'

Edipo --

The second csating doesn't work because PG doesn't recognize the time zone
"BRT" -- despite the fact that it appeared to output it (!). [Full list of
PG timezones at
http://candle.pha.pa.us/main/writings/pgsql/sgml/timezones.html)

What output do you get from

SET DATESTYLE='iso';
SELECT current_timestamp;
SET DATESTYLE='postgres';
SELECT current_timestamp;

And where are you located geographically?



pgsql-sql by date:

Previous
From: "Edipo E. F. Melo"
Date:
Subject: Casting timestamp
Next
From: "Dan MacNeil"
Date:
Subject: count(boolean)