pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: George Weaver <georgew1@mts.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Strange behavior with timestamptz
Date: Tue, 26 Aug 2003 09:08:46 -0400
Message-ID: <7688.1061903326@sss.pgh.pa.us> (raw)
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>

> ... 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



view thread (5+ messages)

Message-ID: <7688.1061903326@sss.pgh.pa.us>
Permalink:  ../7688.1061903326@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7688.1061903326@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, georgew1@mts.net
  Subject: Re: Strange behavior with timestamptz
  In-Reply-To: <7688.1061903326@sss.pgh.pa.us>

* 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