pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: the6campbells <the6campbells@gmail.com>
To: pgsql-sql@postgresql.org
Subject: question about timestamp with tz
Date: Thu, 22 Oct 2009 16:41:20 -0400
Message-ID: <22431f1b0910221341l371b8303w9b3a525afa598d1@mail.gmail.com> (raw)

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

view thread (3+ messages)  latest in thread

Message-ID: <22431f1b0910221341l371b8303w9b3a525afa598d1@mail.gmail.com>
Permalink:  ../22431f1b0910221341l371b8303w9b3a525afa598d1@mail.gmail.com/
Also on:    postgresql.org/message-id/22431f1b0910221341l371b8303w9b3a525afa598d1@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: the6campbells@gmail.com
  Subject: Re: question about timestamp with tz
  In-Reply-To: <22431f1b0910221341l371b8303w9b3a525afa598d1@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox