Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 993C3475BDD for ; Sun, 19 May 2002 09:43:02 -0400 (EDT) Received: from temp.joelburton.com (unknown [209.190.238.101]) by postgresql.org (Postfix) with ESMTP id D5A99475957 for ; Sun, 19 May 2002 09:43:00 -0400 (EDT) Received: from joeltf0d13cyyp (unknown [209.190.238.100]) by temp.joelburton.com (Postfix) with SMTP id 8585A2BD0D; Sun, 19 May 2002 11:25:48 -0400 (EDT) From: "Joel Burton" To: "Edipo E. F. Melo" , "pgsql-sql" Subject: Re: Casting timestamp Date: Sun, 19 May 2002 09:43:04 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal In-Reply-To: <20020519125527.BF7D14758D7@postgresql.org> X-Archive-Number: 200205/193 X-Sequence-Number: 7828 > -----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?