pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: cnliou <cnliou@so-net.net.tw>
To: pgsql-docs@postgresql.org
Subject: Inserting timestamp values
Date: Wed, 03 Dec 2003 00:24:03 +0800 (CST)
Message-ID: <1070382243.61976.cnliou@so-net.net.tw> (raw)

Hi!

Does my test result comply with the statements in section 
"8.5 Date/Time Types"? My shell set local time to UTC+8 
hours. I was in the impression that the query

insert into test values ('2003-2-1'::timestamp);

equals to

insert into test values ('2003-2-1'::timestamp without time 
zone);

but my test results seem to show the other way.

db1=# show time zone;
 TimeZone 
----------
 unknown
(1 row)

db1=# \d test
              Table "public.test"
 Column |           Type           | Modifiers 
--------+--------------------------+-----------
 f1     | timestamp with time zone | 

db1=# insert into test values ('2003-1-1'::timestamp);
INSERT 46230 1
db1=# select * from test;
           f1           
------------------------
 2003-01-01 00:00:00+08
(1 row)

db1=# set time zone 9;
SET
db1=# insert into test values ('2003-2-1'::timestamp);
INSERT 46231 1
db1=# select * from test;
           f1           
------------------------
 2003-01-01 01:00:00+09
 2003-02-01 00:00:00+09
(2 rows)

db1=# set time zone 0;
SET
db1=# select * from test;
           f1           
------------------------
 2002-12-31 16:00:00+00
 2003-01-31 15:00:00+00
(2 rows)

Regards,

CN



view thread (3+ messages)  latest in thread

Message-ID: <1070382243.61976.cnliou@so-net.net.tw>
Permalink:  ../1070382243.61976.cnliou@so-net.net.tw/
Also on:    postgresql.org/message-id/1070382243.61976.cnliou@so-net.net.tw

 · 

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-docs@postgresql.org
  Cc: cnliou@so-net.net.tw
  Subject: Re: Inserting timestamp values
  In-Reply-To: <1070382243.61976.cnliou@so-net.net.tw>

* 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