Re: patch: make_timestamp function

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Jim Nasby <jim(at)nasby(dot)net>
Cc: Fabrízio Mello <fabriziomello(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patch: make_timestamp function
Date: 2013-12-17 15:05:58
Message-ID: CAFj8pRBZA2Vp=kmf5u4As5wr=7O5=j5tSa=csDg0+QEVEuToFg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

updated patch

time zone type functions are overloaded now

postgres=# select '1973-07-15 08:15:55.33+02'::timestamptz;
timestamptz
---------------------------
1973-07-15 07:15:55.33+01
(1 row)

postgres=# SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, 2);
make_timestamptz
---------------------------
1973-07-15 07:15:55.33+01
(1 row)

postgres=# SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33);
make_timestamptz
---------------------------
1973-07-15 08:15:55.33+01
(1 row)

Regards

Pavel

2013/12/15 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>

> Hello
>
>
> 2013/12/13 Jim Nasby <jim(at)nasby(dot)net>
>
>> On 12/13/13 1:49 PM, Fabrízio de Royes Mello wrote:
>>
>>>
>>> On Fri, Dec 13, 2013 at 5:35 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us <mailto:
>>> tgl(at)sss(dot)pgh(dot)pa(dot)us>> wrote:
>>>
>>> >
>>> > =?ISO-8859-1?Q?Fabr=EDzio_de_Royes_Mello?= <fabriziomello(at)gmail(dot)com<mailto:
>>> fabriziomello(at)gmail(dot)com>> writes:
>>> > > I think the goal of the "make_date/time/timestamp" function series
>>> is build
>>> > > a date/time/timestamp from scratch, so the use of
>>> 'make_timestamptz' is to
>>> > > build a specific timestamp with timezone and don't convert it.
>>> >
>>> > Yeah; we don't really want to incur an extra timezone rotation just
>>> to get
>>> > to a timestamptz. However, it's not clear to me if make_timestamptz()
>>> > needs to have an explicit zone parameter or not. It could just assume
>>> > that you meant the active timezone.
>>> >
>>>
>>> +1. And if you want a different timezone you can just set the 'timezone'
>>> GUC.
>>>
>>
>> Why wouldn't we have a version that optionally accepts the timezone? That
>> mirrors what you can currently do with a cast from text, and having to set
>> the GUC if you need a different TZ would be a real PITA.
>>
>
> It is not bad idea.
>
> What will be format for timezone in this case? Is a doble enough?
>
> last version of this patch attached (without overloading in this moment)
>
>
>
>
>> --
>> Jim C. Nasby, Data Architect jim(at)nasby(dot)net
>> 512.569.9461 (cell) http://jim.nasby.net
>>
>
>

Attachment Content-Type Size
make_timestamp-2013-12-17-01.patch text/x-patch 17.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2013-12-17 15:08:52 Re: pg_rewarm status
Previous Message Stephen Frost 2013-12-17 15:00:46 Re: Extension Templates S03E11