pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dave Cramer <pg@fastcrypt.com>
Cc: Christopher BROWN <brown@reflexe.fr>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: PreparedStatement.setDate() behavior with OVERLAPS
Date: Tue, 11 Aug 2015 11:00:09 -0400
Message-ID: <20415.1439305209@sss.pgh.pa.us> (raw)
In-Reply-To: <CADK3HHKZcCOQkbtwiRGfOK0nKRX5DzPnzM_DaOL+B8RM8mjh5A@mail.gmail.com>
References: <CAHL_zcMr0u+xdhGM5vJvt6zTfOGdh9Cp1Pd+gEERe6XC2khMvA@mail.gmail.com>
	<9152.1439301688@sss.pgh.pa.us>
	<CADK3HHJj8B2UyDVQj+xrN-8b8c1sz6kS5dspqsc14peKyMBcZQ@mail.gmail.com>
	<CAHL_zcNck+_fWGMjBa2uiQtGMYyPJoivSsm280Aq3Foz7+kY4Q@mail.gmail.com>
	<CADK3HHLNeRJnsrO0pGVmG29SwO1Y8CRz+y=PaWX8hQRRPmEx6w@mail.gmail.com>
	<CAHL_zcMOGpE1gqs=rnVYhRXjzvQ9DqXrCLAgJft89dgq4RJDqw@mail.gmail.com>
	<CADK3HHK0TzucxG=203imSkrak2m07m-2JB-OV4rjku6is2vdDQ@mail.gmail.com>
	<20118.1439304567@sss.pgh.pa.us>
	<CADK3HHKZcCOQkbtwiRGfOK0nKRX5DzPnzM_DaOL+B8RM8mjh5A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

Dave Cramer <pg@fastcrypt.com> writes:
> Here are the comments in the code.
>   // We must use UNSPECIFIED here, or inserting a Date-with-timezone into a
>   // timestamptz field does an unexpected rotation by the server's TimeZone:

Ugh.  But why not send it as a timestamptz?

(I suspect that the law of conservation of astonishment applies, such that
some other corner cases would act oddly if you do that.  But it might be
a net improvement anyway.)

> Apparently while dates don't store timezone information we do accept
> timezone info in date literals ?

Sure.  Times, too.  The same input parser is used for date, timestamp,
timestamptz, time, and timetz, and then we just throw away irrelevant
fields.

regression=# select '2015-08-11 10:55:04.509393-04'::date;
    date    
------------
 2015-08-11
(1 row)

			regards, tom lane


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



view thread (13+ messages)  latest in thread

Message-ID: <20415.1439305209@sss.pgh.pa.us>
Permalink:  ../20415.1439305209@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20415.1439305209@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pg@fastcrypt.com, brown@reflexe.fr
  Subject: Re: PreparedStatement.setDate() behavior with OVERLAPS
  In-Reply-To: <20415.1439305209@sss.pgh.pa.us>
  References: <CAHL_zcMr0u+xdhGM5vJvt6zTfOGdh9Cp1Pd+gEERe6XC2khMvA@mail.gmail.com> <9152.1439301688@sss.pgh.pa.us> <CADK3HHJj8B2UyDVQj+xrN-8b8c1sz6kS5dspqsc14peKyMBcZQ@mail.gmail.com> <CAHL_zcNck+_fWGMjBa2uiQtGMYyPJoivSsm280Aq3Foz7+kY4Q@mail.gmail.com> <CADK3HHLNeRJnsrO0pGVmG29SwO1Y8CRz+y=PaWX8hQRRPmEx6w@mail.gmail.com> <CAHL_zcMOGpE1gqs=rnVYhRXjzvQ9DqXrCLAgJft89dgq4RJDqw@mail.gmail.com> <CADK3HHK0TzucxG=203imSkrak2m07m-2JB-OV4rjku6is2vdDQ@mail.gmail.com> <20118.1439304567@sss.pgh.pa.us> <CADK3HHKZcCOQkbtwiRGfOK0nKRX5DzPnzM_DaOL+B8RM8mjh5A@mail.gmail.com> <20415.1439305209@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