Re: timezone() with timeofday() converts the wrong direction? - Mailing list pgsql-general

From Karsten Hilbert
Subject Re: timezone() with timeofday() converts the wrong direction?
Date
Msg-id 20050425082847.A565@hermes.hilbert.loc
Whole thread Raw
In response to Re: timezone() with timeofday() converts the wrong direction?  (Michael Fuhr <mike@fuhr.org>)
Responses Re: timezone() with timeofday() converts the wrong direction?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: timezone() with timeofday() converts the wrong direction?  (Michael Fuhr <mike@fuhr.org>)
List pgsql-general
On Sun, Apr 24, 2005 at 04:34:31PM -0600, Michael Fuhr wrote:

> > gnumed=> select version();
> >                             version
> > ---------------------------------------------------------------
> >  PostgreSQL 7.1.3 on i686-pc-linux-gnu, compiled by GCC 2.95.3
>
> That *definitely* isn't anything I'd want.  That version of PostgreSQL
Well :-)

> > gnumed=> create teable test (f timestamp with time zone);
> > CREATE
>
> Does that really work in 7.1.3?  Trying to create a "teable" fails
This results from "script" logging backspaces into the log
file instead of deleting characters in there and my not
spotting that when cleaning up the log file. Nothing to do with
the question at hand.

>   insert into test (f) values (now());
>   INSERT 37830 1
>   SELECT * from test;
>                  f
>   -------------------------------
>    2005-04-24 22:25:51.669218+00
>   (1 row)
>
>   select f, f::timestamp at time zone 'MEZ' from test;
>                  f               |          timezone
>   -------------------------------+----------------------------
>    2005-04-24 22:25:51.669218+00 | 2005-04-24 23:25:51.669218
>   (1 row)
Huh ? This IS different time zones from the same timestamp
within the same query, isn't it ??

The fact that different versions of PostgreSQL get it right or
wrong in a variety of ways indicates that the logic may need
to be fixed but does show that in principle it is quite
possible. If that's not what you wanted to do then I did
misunderstand your original question.

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

pgsql-general by date:

Previous
From: ElayaRaja S
Date:
Subject: Help-Urgent
Next
From: Tom Lane
Date:
Subject: Re: timezone() with timeofday() converts the wrong direction?