Thread: Europe/Moscow timezone

Europe/Moscow timezone

From
"Brandon Metcalf"
Date:
From what I can tell, PostgreSQL 8.0.3 should support Europe/Moscow as
a timezone input string.  However, this doesn't seem to work:

  db=> INSERT INTO synctimes (time, sreplica, shost, dreplica, dhost, seconds, pseconds) VALUES ('10-05-2006 18:26:13
Europe/Moscow',9407, 27362, 18516, 35361, 1606, 47); 
  ERROR:  invalid input syntax for type timestamp with time zone: "10-05-2006 18:26:13 Europe/Moscow"

Any ideas as to what I'm doing wrong here?

Thanks.

--
Brandon

Re: Europe/Moscow timezone

From
Martijn van Oosterhout
Date:
On Fri, Oct 06, 2006 at 09:10:33AM -0500, Brandon Metcalf wrote:
> >From what I can tell, PostgreSQL 8.0.3 should support Europe/Moscow as
> a timezone input string.  However, this doesn't seem to work:
>
>   db=> INSERT INTO synctimes (time, sreplica, shost, dreplica, dhost, seconds, pseconds) VALUES ('10-05-2006 18:26:13
Europe/Moscow',9407, 27362, 18516, 35361, 1606, 47); 
>   ERROR:  invalid input syntax for type timestamp with time zone: "10-05-2006 18:26:13 Europe/Moscow"
>
> Any ideas as to what I'm doing wrong here?

8.0 only supports such timezones in the form:

'10-05-2006 18:26:13' AT TIME ZONE 'Europe/Moscow';

Including it in the string is only supported from 8.2 beta onward. So
try that out and see how it goes.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

Re: Europe/Moscow timezone

From
"A. Kretschmer"
Date:
am  Fri, dem 06.10.2006, um  9:10:33 -0500 mailte Brandon Metcalf folgendes:
> >From what I can tell, PostgreSQL 8.0.3 should support Europe/Moscow as
> a timezone input string.  However, this doesn't seem to work:
>
>   db=> INSERT INTO synctimes (time, sreplica, shost, dreplica, dhost, seconds, pseconds) VALUES ('10-05-2006 18:26:13
Europe/Moscow',9407, 27362, 18516, 35361, 1606, 47); 
>   ERROR:  invalid input syntax for type timestamp with time zone: "10-05-2006 18:26:13 Europe/Moscow"
>
> Any ideas as to what I'm doing wrong here?

Perhaps an error in this version, i have 8.1, or wrong syntax.


test=# select TIMESTAMP WITH TIME ZONE '10-05-2006 18:26:13 ' AT TIME ZONE 'Europe/Moscow';
      timezone
---------------------
 2006-10-05 20:26:13
(1 row)


Try this:

test=# insert into xy values (TIMESTAMP WITH TIME ZONE '10-05-2006 18:26:13' AT TIME ZONE 'Europe/Moscow');
INSERT 0 1



Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47215,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

Re: Europe/Moscow timezone

From
Tom Lane
Date:
"Brandon Metcalf" <bmetcalf@nortel.com> writes:
> From what I can tell, PostgreSQL 8.0.3 should support Europe/Moscow as
> a timezone input string.

Sorry, no.  That's actually new for 8.2.

            regards, tom lane

Re: Europe/Moscow timezone

From
"Brandon Metcalf"
Date:
k == kleptog@svana.org writes:

 k> On Fri, Oct 06, 2006 at 09:10:33AM -0500, Brandon Metcalf wrote:
 k> > >From what I can tell, PostgreSQL 8.0.3 should support Europe/Moscow as
 k> > a timezone input string.  However, this doesn't seem to work:
 k> >
 k> >   db=> INSERT INTO synctimes (time, sreplica, shost, dreplica, dhost, seconds, pseconds) VALUES ('10-05-2006
18:26:13Europe/Moscow', 9407, 27362, 18516, 35361, 1606, 47); 
 k> >   ERROR:  invalid input syntax for type timestamp with time zone: "10-05-2006 18:26:13 Europe/Moscow"
 k> >
 k> > Any ideas as to what I'm doing wrong here?

 k> 8.0 only supports such timezones in the form:

 k> '10-05-2006 18:26:13' AT TIME ZONE 'Europe/Moscow';

 k> Including it in the string is only supported from 8.2 beta onward. So
 k> try that out and see how it goes.


That doesn't work, either.

  db=> INSERT INTO synctimes (time, sreplica, shost, dreplica, dhost, seconds, pseconds) VALUES ('10-05-2006 18:26:13'
ATTIME ZONE 'Europe/Moscow', 999999, 27362, 18516, 35361, 1606, 47); 
  ERROR:  time zone "europe/moscow" not recognized

--
Brandon

Re: Europe/Moscow timezone

From
Tom Lane
Date:
"Brandon Metcalf" <bmetcalf@nortel.com> writes:
> k == kleptog@svana.org writes:
>  k> 8.0 only supports such timezones in the form:
>  k> '10-05-2006 18:26:13' AT TIME ZONE 'Europe/Moscow';

> That doesn't work, either.

I think AT TIME ZONE was updated to allow long-form tz names in 8.1.
In 8.0 you probably can't do anything except SET TIME ZONE with 'em.

            regards, tom lane