Re: Casting timestamp

From: "Joel Burton" <joel(at)joelburton(dot)com>
To: "Edipo E(dot) F(dot) Melo" <edipoelder(at)ig(dot)com(dot)br>, "pgsql-sql" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Casting timestamp
Date: 2002-05-19 13:43:04
Message-ID: JGEPJNMCKODMDHGOBKDNAELLCOAA.joel@joelburton.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> -----Original Message-----
> From: pgsql-sql-owner(at)postgresql(dot)org
> [mailto:pgsql-sql-owner(at)postgresql(dot)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?

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Dan MacNeil 2002-05-19 14:16:47 count(boolean)
Previous Message Edipo E. F. Melo 2002-05-18 23:54:56 Casting timestamp