Re: Binary timestamp with without timezone

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Radosław Smogura <rsmogura(at)softperience(dot)eu>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Binary timestamp with without timezone
Date: 2010-12-20 16:31:23
Message-ID: AANLkTinSO_Bb=zMet0sxy1en39qtaA++xOK1G-fB1=NT@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Dec 20, 2010 at 6:29 AM, Radosław Smogura
<rsmogura(at)softperience(dot)eu> wrote:
>
> On Thu, 16 Dec 2010 14:24:27 -0500, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>
>> =?utf-8?q?Rados=C5=82aw_Smogura?= <rsmogura(at)softperience(dot)eu> writes:
>>>
>>> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> Thursday 16 December 2010 18:59:56
>>>>
>>>> =?utf-8?q?Rados=C5=82aw_Smogura?= <rsmogura(at)softperience(dot)eu> writes:
>>>>>
>>>>> ... This timestamp must be properly encoded
>>>>> depending if target is WITH TZ or not, but JDBC (and other clients,
>>>>> probably too) doesn't have any knowledge about target type when
>>>>> statement is executed
>>
>>>> Seems like you need to fix *that*.
>>
>>> I don't say it's bad way to send timestamps in text mode. It's good
>>> solution,
>>> because timestamp without tz will silently ignore tz offset, timestamp
>>> with tz
>>> will use offset in calculations if it is there, if no it will use server
>>> TZ.
>>
>> No, what I'm saying is that it's complete folly to be sending binary
>> data for a value you don't know the exact type of.
>
> I know something about value I want to send, but only this it should be a
> timestamp. I don't know if it should be with or without tz.

That's your problem right there, full stop. If you don't know if your
time is with or without tz, how can you possibly expect the server to
know? Either send without tz, or grab the time zone from the local
environment and convert to binary timezone tz. Your issue has
absolutely nothing to do with which protocol you are using.

merlin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2010-12-20 16:36:04 Re: Extensions and custom_variable_classes
Previous Message Robert Haas 2010-12-20 16:27:47 Re: bug in SignalSomeChildren