Re: to_char_at_timezone()?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: to_char_at_timezone()?
Date: 2014-11-05 18:36:12
Message-ID: 545A6E1C.9070006@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/04/2014 04:04 PM, Marko Tiikkaja wrote:
> On 11/5/14, 12:59 AM, Tom Lane wrote:
>> Marko Tiikkaja <marko(at)joh(dot)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.

Why wouldn't we just add the timezone as an additional parameter?

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Tiikkaja 2014-11-05 18:39:47 Re: to_char_at_timezone()?
Previous Message Merlin Moncure 2014-11-05 18:09:16 Re: intel s3500 -- hot stuff