Re: to_char_at_timezone()? - Mailing list pgsql-hackers

From Marko Tiikkaja
Subject Re: to_char_at_timezone()?
Date
Msg-id 5459698C.9040903@joh.to
Whole thread Raw
In response to Re: to_char_at_timezone()?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 11/5/14, 12:59 AM, Tom Lane wrote:
> Marko Tiikkaja <marko@joh.to> writes:
>> So I got into thinking whether it would make sense to provide a new
>> function, say, to_char_at_timezone() to solve this problem.  For example:
>> ...
>> Any thoughts?  The patch is quite trivial.
>
> I'm not convinced that it's all that trivial.  Is the input timestamp or
> timestamptz, and what's the semantics of that exactly (ie what timezone
> rotation happens)?  One's first instinct is often wrong in this area.

In my example, the input is a "timestamptz", and the output is converted 
to the target time zone the same way timestamptz_out() does, except 
based on the input timezone instead of TimeZone.

Not sure whether it would make sense to do this for "timestamp", or 
whether there's even a clear intuitive behaviour there.


.marko



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: to_char_at_timezone()?
Next
From: Álvaro Hernández Tortosa
Date:
Subject: Re: Repeatable read and serializable transactions see data committed after tx start