pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ken Johanson <pg-user@kensystem.com>
To: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Timestamp without Timezone and differing client / server tzs
Date: Tue, 08 Jul 2008 23:25:52 -0600
Message-ID: <48744BE0.1010304@kensystem.com> (raw)
In-Reply-To: <4874419A.6030705@opencloud.com>
References: <4873154E.6020808@kensystem.com>
	<4873201F.1000700@opencloud.com>
	<487439D8.2050508@kensystem.com>
	<48743B53.4000002@opencloud.com>
	<48743F0C.6020504@kensystem.com>
	<4874419A.6030705@opencloud.com>

Oliver Jowett wrote:
>>> Ken Johanson wrote:
>> This is useful where plural databases (not under my control) may exist 
>> each in different timezones, and the app must deal with each 
>> concurrently; where storing server configs (separate from the URL) and 
>> passing Calendar objects for each, could be avoided.
> 
> But if you are using timestamp-without-timezone in each database, I 
> don't understand why the server timezone comes into the equation at all? 

The servers and their schema (use-of ts w/o tz are not under my control; 
adding with-timezone would likely break apps that transmit date values 
with offset already normalized).

> 
> Can you give me some concrete examples of schema + app code and how you 
> would want it to behave?
> 

Just to pass-in a timestamp, and which ever database it is sent to, be 
stored with its real atomic (integer) value (ie string conversion 
normalized to what db uses).

Simplified:

Timestamp NOW = new Timestamp(System.currentTimeMillis());
for (int i=0; i<SERVERS.length; i++)
{
Connection con = ....//SERVERS[i] etc; each server exists in different 
timezone, and datetime/timestamps cols do not store zone.
PreparedStatement ps = con.prepareStatement("INSERT INTO tbl 
(lastModified) VALUES (?)");
ps.setTimestamp(1, NOW));
ps.executeUpdate();
}

k





view thread (15+ messages)  latest in thread

Message-ID: <48744BE0.1010304@kensystem.com>
Permalink:  ../48744BE0.1010304@kensystem.com/
Also on:    postgresql.org/message-id/48744BE0.1010304@kensystem.com

 · 

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: pg-user@kensystem.com, oliver@opencloud.com
  Subject: Re: Timestamp without Timezone and differing client / server tzs
  In-Reply-To: <48744BE0.1010304@kensystem.com>
  References: <4873154E.6020808@kensystem.com> <4873201F.1000700@opencloud.com> <487439D8.2050508@kensystem.com> <48743B53.4000002@opencloud.com> <48743F0C.6020504@kensystem.com> <4874419A.6030705@opencloud.com> <48744BE0.1010304@kensystem.com>

* 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