Timestamp with time zone - Mailing list pgsql-novice

From Xavier Robin
Subject Timestamp with time zone
Date
Msg-id 4C2B3FB9.20800@bluewin.ch
Whole thread Raw
List pgsql-novice
Hello,

I'm running a Debian Lenny box with PostgreSQL 8.4.4 from the backports.
I have a question regarding timestamps with time zone. I can't get time
zones inserted into my timestamp with time zone columns. For example:

> CREATE TABLE testcase(
>     created TIMESTAMP WITH TIME ZONE
> );
> INSERT INTO testcase VALUES (TIMESTAMP WITH TIME ZONE '2005-01-01 00:00+01');
> SELECT created, EXTRACT(TIMEZONE FROM created) FROM testcase;
>         created         | date_part
> ------------------------+-----------
>  2004-12-31 23:00:00+00 |         0
> (1 ligne)

Or from the docs:

> SELECT TIMESTAMP WITH TIME ZONE '2004-10-19 10:23:54+02';
>       timestamptz
> ------------------------
>  2004-10-19 08:23:54+00

In both examples, the timezone is lost. I read that

> To ensure that a literal is treated as timestamp with time zone, give it the correct explicit type

but how can I do that in pactice?

Thanks,
Xavier


Attachment

pgsql-novice by date:

Previous
From: Xavier Robin
Date:
Subject: Timestamp with time zone
Next
From: Tim Landscheidt
Date:
Subject: Re: Timestamp with time zone