question about timestamp with tz

From: the6campbells <the6campbells(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: question about timestamp with tz
Date: 2009-10-22 20:41:20
Message-ID: 22431f1b0910221341l371b8303w9b3a525afa598d1@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Question.. is there a way that I can get Postgres to return the tz as
supplied on the insert statement

insert into TTSTZ(RNUM, CTSTZ) values ( 0, null);
insert into TTSTZ(RNUM, CTSTZ) values ( 1, timestamp with time zone
'2000-12-31 12:00:00.0-05:00');
insert into TTSTZ(RNUM, CTSTZ) values ( 2, timestamp with time zone
'2000-12-31 12:00:00+00:00');
insert into TTSTZ(RNUM, CTSTZ) values ( 3, timestamp with time zone
'2000-12-31 12:00:00.0+05:00');

select rnum, CTSTZ

0;""
1;"2000-12-31 12:00:00-05"
2;"2000-12-31 07:00:00-05"
3;"2000-12-31 02:00:00-05"

select rnum, extract (hour from ctstz), extract (timezone_hour from ctstz)
from ttstz

0;;
1;12;-5
2;7;-5
3;2;-5

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message the6campbells 2009-10-22 21:04:50 date + interval year - why is the return type convered to a timestamp?
Previous Message Tom Lane 2009-10-22 18:28:37 Re: Assigning Values to Composite Types