X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 6E50CD1D93E for ; Tue, 2 Dec 2003 16:25:24 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 47605-05 for ; Tue, 2 Dec 2003 12:24:56 -0400 (AST) Received: from mail2000-2.so-net.net.tw (unknown [61.64.127.18]) by svr1.postgresql.org (Postfix) with SMTP id 9238AD1C951 for ; Tue, 2 Dec 2003 12:24:51 -0400 (AST) Received: By OpenMail Mailer;Wed, 03 Dec 2003 00:24:04 +0800 (CST) From: "cnliou" Reply-To: cnliou@so-net.net.tw Subject: Inserting timestamp values Message-ID: <1070382243.61976.cnliou@so-net.net.tw> To: "" Date: Wed, 03 Dec 2003 00:24:03 +0800 (CST) MIME-Version: 1.0 Content-Type: text/plain X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/12 X-Sequence-Number: 2172 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