pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
timestamp with time zone wire format
5+ messages / 2 participants
[nested] [flat]

* timestamp with time zone wire format
@ 2015-12-14 13:24 Philippe Marschall <pm@netcetera.ch>
  2015-12-14 13:43 ` Re: timestamp with time zone wire format Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Philippe Marschall @ 2015-12-14 13:24 UTC (permalink / raw)
  To: pgsql-jdbc

Hi

I'm a bit annoyed by the lack of java.time / JSR-310 support (mostly 
ZonedDateTime and OffsetDateTime). Annoyed enough to look into what 
would be required to implement it. The first thing I would need is a 
documentation of the wire format of TIMESTAMP WITH TIME ZONE 
(Oid.TIMESTAMPTZ I believe) so that I can write parse code. I first 
though about putting it into TimestampUtils but for backwards 
compatibility with older Java/JDBC versions a dedicated class would 
probably be better.

This is not a promise that I'll work on it let alone deliver something.

Cheers
Philippe


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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: timestamp with time zone wire format
  2015-12-14 13:24 timestamp with time zone wire format Philippe Marschall <pm@netcetera.ch>
@ 2015-12-14 13:43 ` Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  2015-12-15 08:01   ` Re: timestamp with time zone wire format Philippe Marschall <pm@netcetera.ch>
  0 siblings, 1 reply; 5+ messages in thread

From: Vladimir Sitnikov @ 2015-12-14 13:43 UTC (permalink / raw)
  To: pm@netcetera.ch; +Cc: pgsql-jdbc

> I can write parse code

Parse code for timestampTZ is probably there. The missing part is
conversion from-to JSR-310.

> for backwards compatibility with older Java/JDBC versions a dedicated class would probably be better

Things will get much easier after
https://github.com/pgjdbc/pgjdbc/pull/435 is merged in.
It will enable pre-processor, so it would be possible to seamlessly
integrate java.time right into `statement.getObject` without failing
the build for older java versions.

Here's an example:
https://github.com/vlsi/pgjdbc/blob/2236505772e8d36640929b8a75fa3857f0bfbb94/core/src/main/java/org/...

Vladimir


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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: timestamp with time zone wire format
  2015-12-14 13:24 timestamp with time zone wire format Philippe Marschall <pm@netcetera.ch>
  2015-12-14 13:43 ` Re: timestamp with time zone wire format Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
@ 2015-12-15 08:01   ` Philippe Marschall <pm@netcetera.ch>
  2015-12-15 08:16     ` Re: timestamp with time zone wire format Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Philippe Marschall @ 2015-12-15 08:01 UTC (permalink / raw)
  To: pgsql-jdbc; +Cc: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>

On 14.12.15 14:43, Vladimir Sitnikov wrote:
>> I can write parse code
>
> Parse code for timestampTZ is probably there. The missing part is
> conversion from-to JSR-310.

The only thing I could find is TimestampUtils#toTimestampBin [1] there 
the time zone either comes from the caller or the system default, never 
the database. Form reading the docs I get the impression the time zone 
isn't stored so there's nothing to parse.

>> for backwards compatibility with older Java/JDBC versions a dedicated class would probably be better
>
> Things will get much easier after
> https://github.com/pgjdbc/pgjdbc/pull/435 is merged in.

Is there an ETA for this?

  [1] 
https://github.com/pgjdbc/pgjdbc/blob/master/org/postgresql/jdbc2/TimestampUtils.java#L623

Cheers
Philippe



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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: timestamp with time zone wire format
  2015-12-14 13:24 timestamp with time zone wire format Philippe Marschall <pm@netcetera.ch>
  2015-12-14 13:43 ` Re: timestamp with time zone wire format Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  2015-12-15 08:01   ` Re: timestamp with time zone wire format Philippe Marschall <pm@netcetera.ch>
@ 2015-12-15 08:16     ` Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  2015-12-15 08:40       ` Re: timestamp with time zone wire format Philippe Marschall <pm@netcetera.ch>
  0 siblings, 1 reply; 5+ messages in thread

From: Vladimir Sitnikov @ 2015-12-15 08:16 UTC (permalink / raw)
  To: Philippe Marschall <pm@netcetera.ch>; +Cc: pgsql-jdbc

> time zone either comes from the caller or the system default, never the database

As far as I can tell, DB does not send time zone when using binary
encoding (see [1]).

[1] https://github.com/postgres/postgres/blob/d4355425831fe8f6a68095393e3628cb30d06b3f/src/backend/utils...

>Is there an ETA for this?

Hopefully it will be in 2015.

Vladimir


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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: timestamp with time zone wire format
  2015-12-14 13:24 timestamp with time zone wire format Philippe Marschall <pm@netcetera.ch>
  2015-12-14 13:43 ` Re: timestamp with time zone wire format Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  2015-12-15 08:01   ` Re: timestamp with time zone wire format Philippe Marschall <pm@netcetera.ch>
  2015-12-15 08:16     ` Re: timestamp with time zone wire format Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
@ 2015-12-15 08:40       ` Philippe Marschall <pm@netcetera.ch>
  0 siblings, 0 replies; 5+ messages in thread

From: Philippe Marschall @ 2015-12-15 08:40 UTC (permalink / raw)
  To: pgsql-jdbc

On 15.12.15 09:16, Vladimir Sitnikov wrote:
>> time zone either comes from the caller or the system default, never the database
>
> As far as I can tell, DB does not send time zone when using binary
> encoding (see [1]).

And for non binary encoding it will probably use the system's TimeZone 
parameter.

Cheers
Philippe



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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2015-12-15 08:40 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-12-14 13:24 timestamp with time zone wire format Philippe Marschall <pm@netcetera.ch>
2015-12-14 13:43 ` Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
2015-12-15 08:01   ` Philippe Marschall <pm@netcetera.ch>
2015-12-15 08:16     ` Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
2015-12-15 08:40       ` Philippe Marschall <pm@netcetera.ch>

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