Re: storing TZ along timestamps - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: storing TZ along timestamps
Date
Msg-id BANLkTikA4aZQaKn4V1RGQdAG2g3ddL5Vrw@mail.gmail.com
Whole thread Raw
In response to Re: storing TZ along timestamps  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
On Thu, Jun 2, 2011 at 12:55 PM, Alvaro Herrera
<alvherre@commandprompt.com> wrote:
>> >> > One of our customers is interested in being able to store original
>> >> > timezone along with a certain timestamp.
>> >>
>> >> I assume that you're talking about a new data type, not augmenting the
>> >> current types, correct?
>> >
>> > Yes
>>
>> why not use a composite type for that?  performance maybe?
>
> To avoid having to implement all the operators and lookup tables (of
> timezones) in userland, mainly.  Probably performance would be affected
> too, not sure, but that's not the main point.

right -- I see where you are going with this.  ok, some random questions:
*) what about making a 'timezone' type in addition to (or even instead
of) the timezonetz_inputtz?  Then you could in theory treat the your
proposed type as a composite of timezonetz and timezone, just as
timestamptz is a 'composite' of date and timetz.  (note I'm not
necessarily arguing against the creation of a specific unified type --
performance is important for time types).

*) in/out formats...what would be the wire formats of your type -- in
particular, the binary format?

*) do you see your type interacting with various datetime function
(like extract) or will a cast be required?  Interval math?

*) how does ordering and uniqueness apply to same timestamps with
unique input time zones?

merlin


pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: storing TZ along timestamps
Next
From: Tom Lane
Date:
Subject: Re: Estimating total amount of shared memory required by postmaster