X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 89633D1D6B9 for ; Tue, 2 Dec 2003 17:28:03 +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 55432-09 for ; Tue, 2 Dec 2003 13:27:37 -0400 (AST) Received: from mail2000-3.so-net.net.tw (mail2000-3.so-net.net.tw [61.64.127.19]) by svr1.postgresql.org (Postfix) with SMTP id E7B22D1B4A0 for ; Tue, 2 Dec 2003 13:27:31 -0400 (AST) Received: By OpenMail Mailer;Wed, 03 Dec 2003 01:27:36 +0800 (CST) From: "cnliou" Reply-To: cnliou@so-net.net.tw Subject: Inserting timestamp values from windowz application Message-ID: <1070386056.30928.cnliou@so-net.net.tw> To: "" Date: Wed, 03 Dec 2003 01:27:36 +0800 (CST) MIME-Version: 1.0 Content-Type: text/plain X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/7 X-Sequence-Number: 4616 Hi! I am inserting timestamp values from C++Builder project1.exe compiled with ZEOSLIB on Win98 (set to time zone UTC+8 hours) into the table: CREATE TABLE (c1 TIMESTAMP WITH TIME ZONE); After project1.exe connects to postgres via libpq.dll, the query SHOW TIME ZONE returns "unknown", which is as expected. Then I do the insert from project1.exe: INSERT INTO test VALUES (CAST('2003-1-1' AS TIMESTAMP)); What weird is that this datetime value is saved to column c1 as 2002-12-31 16:00:00 UTC. This means that some component among zeoslib, libpq, win98, or postgres is _too_ smart that it assumes the to-insert value being local time at time zone UTC+08 and converts the value to UTC. This automatic behavior is not what I would like to see. I guess zeoslib is unlikely to be the component that does the conversion. How does this smart component know that the to-insert value stands for the local time at UTC+08 time zone? I need a "manual" way to explicitly tell postgres the client's time zone by sending from project1.exe the query "SET TIME ZONE -5" or the like to postgres. Would anyone kindly offer some solutions to my requirement or explanations for the symptom? Regards, CN