Re: storing TZ along timestamps

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: storing TZ along timestamps
Date: 2011-06-02 18:36:22
Message-ID: BANLkTikA4aZQaKn4V1RGQdAG2g3ddL5Vrw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 2, 2011 at 12:55 PM, Alvaro Herrera
<alvherre(at)commandprompt(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2011-06-02 18:37:45 Re: storing TZ along timestamps
Previous Message Robert Haas 2011-06-02 18:35:31 Re: InitProcGlobal cleanup