X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id CCB97D1B897 for ; Tue, 26 Aug 2003 10:09:24 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 03526-06 for ; Tue, 26 Aug 2003 10:08:50 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 1C39AD1B56C for ; Tue, 26 Aug 2003 10:08:47 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h7QD8k5H007689; Tue, 26 Aug 2003 09:08:46 -0400 (EDT) To: "George Weaver" Cc: pgsql-sql@postgresql.org Subject: Re: Strange behavior with timestamptz In-reply-to: <001801c36bcd$a25a7210$9c08a18e@cleartag> References: <006801c36b35$524ecac0$4f0da18e@cleartag> <10999.1061845179@sss.pgh.pa.us> <001701c36b7d$1d44fb90$950fa18e@cleartag> <001801c36bcd$a25a7210$9c08a18e@cleartag> Comments: In-reply-to "George Weaver" message dated "Tue, 26 Aug 2003 07:28:18 -0500" Date: Tue, 26 Aug 2003 09:08:46 -0400 Message-ID: <7688.1061903326@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/306 X-Sequence-Number: 14922 > ... When the datereceived parameter was defined > as type Date, it was actually arriving at the procedure as "11-08-2003" and > "25-08-2003" in spite of showing up as indicated below. When I redefined > the datereceived parameter as type OdbcDate, it arrived correctly at the > procedure as "2003-08-11" and "2003-08-25". Yeah. The first two formats are ambiguous, in Postgres' mind anyway. With the US datestyle setting, it will first attempt to parse as mm-dd-yyyy and if that fails try dd-mm-yyyy. So you'd need to change the datestyle to Euro to get dd-mm-yyyy input to be parsed reliably. As of 7.4 this is being tightened up, btw --- it'll be mm-dd-yyyy or error. But AFAICS this has nothing to do with a default now() insertion, because that value is never converted to a string before it gets into the stored column. regards, tom lane