Re: Binary timestamp with without timezone - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: Binary timestamp with without timezone
Date
Msg-id AANLkTinSO_Bb=zMet0sxy1en39qtaA++xOK1G-fB1=NT@mail.gmail.com
Whole thread Raw
In response to Re: Binary timestamp with without timezone  (Radosław Smogura <rsmogura@softperience.eu>)
List pgsql-hackers
On Mon, Dec 20, 2010 at 6:29 AM, Radosław Smogura
<rsmogura@softperience.eu> wrote:
>
> On Thu, 16 Dec 2010 14:24:27 -0500, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>
>> Radosław Smogura <rsmogura@softperience.eu> writes:
>>>
>>> Tom Lane <tgl@sss.pgh.pa.us> Thursday 16 December 2010 18:59:56
>>>>
>>>> Radosław Smogura <rsmogura@softperience.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


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: bug in SignalSomeChildren
Next
From: Dimitri Fontaine
Date:
Subject: Re: Extensions and custom_variable_classes