Re: patch: make_timestamp function

Lists: pgsql-hackers
From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: patch: make_timestamp function
Date: 2013-12-12 17:11:48
Message-ID: CAFj8pRBwqALkzc=1WV+h5e+DcALY2EizjHCvFi9vHbs+z1OhjA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello

this patch try to complete a set of functions make_date and make_timestamp.

Regards

Pavel

Attachment Content-Type Size
make_timestamp.patch text/x-patch 6.9 KB

From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patch: make_timestamp function
Date: 2013-12-12 22:50:26
Message-ID: CAFcNs+ozvCdpzgyj8gK2fxnAFgeBFiCAh30JRaF6JRyKWmvc3g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Dec 12, 2013 at 3:11 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>wrote:

> Hello
>
> this patch try to complete a set of functions make_date and make_timestamp.
>
>
Could we have the 'make_timestamptz' function too?

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Fabrízio Mello <fabriziomello(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patch: make_timestamp function
Date: 2013-12-13 09:09:02
Message-ID: CAFj8pRBuEJrBupHnCF7ahEQMzL=7QjM-HU4_5zi6x+q8uH+=wg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2013/12/12 Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>

>
> On Thu, Dec 12, 2013 at 3:11 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>wrote:
>
>> Hello
>>
>> this patch try to complete a set of functions make_date and
>> make_timestamp.
>>
>>
> Could we have the 'make_timestamptz' function too?
>

I though about it. Then there are two questions

a) Could we have a make_timetz function?

b) What type we use for timezone?

Regards

Pavel Stehule

>
> Regards,
>
> --
> Fabrízio de Royes Mello
> Consultoria/Coaching PostgreSQL
> >> Timbira: http://www.timbira.com.br
> >> Blog sobre TI: http://fabriziomello.blogspot.com
> >> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
> >> Twitter: http://twitter.com/fabriziomello
>


From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patch: make_timestamp function
Date: 2013-12-13 13:37:58
Message-ID: CAFcNs+qomxpLLYiX3xAdJwd7zGRjCs3news2RhwHEkdvRfOkqQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Dec 13, 2013 at 7:09 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
wrote:
>
> I though about it. Then there are two questions
>
> a) Could we have a make_timetz function?
>
> b) What type we use for timezone?
>

I just think in a function that returns the timestamp with timezone based
on the current 'timezone' setting.

fabrizio=# show timezone;
TimeZone
-------------
Brazil/East
(1 row)

fabrizio=# select '2013-12-13 11:29:45.786937'::timestamptz;
timestamptz
-------------------------------
2013-12-13 11:29:45.786937-02
(1 row)

fabrizio=# set timezone to 'UTC';
SET
fabrizio=# select '2013-12-13 11:29:45.786937'::timestamptz;
timestamptz
-------------------------------
2013-12-13 11:29:45.786937+00
(1 row)

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello


From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patch: make_timestamp function
Date: 2013-12-13 17:53:41
Message-ID: 20131213175340.GB11381@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Dec 12, 2013 at 08:50:26PM -0200, Fabrízio de Royes Mello wrote:
> On Thu, Dec 12, 2013 at 3:11 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>wrote:
>
> > Hello
> >
> > this patch try to complete a set of functions make_date and make_timestamp.
> >
> >
> Could we have the 'make_timestamptz' function too?

Wouldn't this just be:

SELECT make_timestamp(...) at time zone 'foo';

(assuming make_timestamp actually returns a timestamp and not a
timestamptz).

or do you mean something else?

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> He who writes carelessly confesses thereby at the very outset that he does
> not attach much importance to his own thoughts.
-- Arthur Schopenhauer


From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patch: make_timestamp function
Date: 2013-12-13 18:17:32
Message-ID: CAFcNs+qkHGpiLi2p5DmGuaxkHpbV-ASpR3K0fw+oLrNfKuQpag@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Dec 13, 2013 at 3:53 PM, Martijn van Oosterhout <kleptog(at)svana(dot)org>
wrote:
>
> On Thu, Dec 12, 2013 at 08:50:26PM -0200, Fabrízio de Royes Mello wrote:
> > On Thu, Dec 12, 2013 at 3:11 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com
>wrote:
> >
> > > Hello
> > >
> > > this patch try to complete a set of functions make_date and
make_timestamp.
> > >
> > >
> > Could we have the 'make_timestamptz' function too?
>
> Wouldn't this just be:
>
> SELECT make_timestamp(...) at time zone 'foo';
>
> (assuming make_timestamp actually returns a timestamp and not a
> timestamptz).
>
> or do you mean something else?
>

Your example will convert the timestamp into time zone defined by 'at time
zone...'.

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.

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: fabriziomello(at)gmail(dot)com
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patch: make_timestamp function
Date: 2013-12-13 19:35:14
Message-ID: 574.1386963314@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

=?ISO-8859-1?Q?Fabr=EDzio_de_Royes_Mello?= <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.

regards, tom lane


From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patch: make_timestamp function
Date: 2013-12-13 19:49:48
Message-ID: CAFcNs+qdibWZLZEYGdgNnDpxGVa2Jt0F_CxRNxkkiAa_6cSAEA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Dec 13, 2013 at 5:35 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> =?ISO-8859-1?Q?Fabr=EDzio_de_Royes_Mello?= <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.

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: fabriziomello(at)gmail(dot)com, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patch: make_timestamp function
Date: 2013-12-13 20:01:44
Message-ID: 52AB67A8.3070306@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 12/13/2013 02:35 PM, Tom Lane wrote:
> =?ISO-8859-1?Q?Fabr=EDzio_de_Royes_Mello?= <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.
>
>

Why not overload the function, with one version having the explicit TZ
param?

cheers

andrew


From: Jim Nasby <jim(at)nasby(dot)net>
To: fabriziomello(at)gmail(dot)com, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patch: make_timestamp function
Date: 2013-12-13 20:04:11
Message-ID: 52AB683B.1060603@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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.
--
Jim C. Nasby, Data Architect jim(at)nasby(dot)net
512.569.9461 (cell) http://jim.nasby.net


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-15 18:59:01
Message-ID: CAFj8pRBRH3S9yWpmOpNYtAyriJjODGLd2eYEjfyYWFBMehoc8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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.patch text/x-patch 15.0 KB

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
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

From: Jim Nasby <jim(at)nasby(dot)net>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
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:59:39
Message-ID: 52B074EB.50609@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 12/15/13, 12:59 PM, Pavel Stehule wrote:
> 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?

Sorry for not seeing this earlier, but no, I think double is barking up the wrong tree. It should accept the same timezone identifiers that the rest of the system does, like blah AT TIME ZONE foo and SET timezone = foo;

Specifically, it needs to support things like 'GMT' and 'CST6CDT'.

I can see an argument for another version that accepts numeric so if you want to do -11.5 you don't have to wrap it in quotes...
--
Jim C. Nasby, Data Architect jim(at)nasby(dot)net
512.569.9461 (cell) http://jim.nasby.net


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 16:11:08
Message-ID: CAFj8pRC2Z-n5nXGKdapmX+Dn63V7SyQcFt+2co+C0upiS=nRgA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2013/12/17 Jim Nasby <jim(at)nasby(dot)net>

> On 12/15/13, 12:59 PM, Pavel Stehule wrote:
>
>> 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?
>>
>
> Sorry for not seeing this earlier, but no, I think double is barking up
> the wrong tree. It should accept the same timezone identifiers that the
> rest of the system does, like blah AT TIME ZONE foo and SET timezone = foo;
>

I checked a code from datetime parser, and there we are not consistent

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

postgres=# select '1973-07-15 08:15:55.33+02.2'::timestamptz;
ERROR: invalid input syntax for type timestamp with time zone: "1973-07-15
08:15:55.33+02.2"
LINE 1: select '1973-07-15 08:15:55.33+02.2'::timestamptz;

It allows only integer

but AT TIME ZONE allows double (but decimal parts is ignored quietly)

postgres=# select make_time(10,20,30) at time zone '+10.2';
timezone
-------------
23:20:30-10

so I propose (and I implemented) a variant with int as time zone

and we can (if we would) implement next one with text as time zone

Regards

Pavel

>
> Specifically, it needs to support things like 'GMT' and 'CST6CDT'.
>
> I can see an argument for another version that accepts numeric so if you
> want to do -11.5 you don't have to wrap it in quotes...
>
> --
> Jim C. Nasby, Data Architect jim(at)nasby(dot)net
> 512.569.9461 (cell) http://jim.nasby.net
>


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Jim Nasby <jim(at)nasby(dot)net>, 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 16:14:32
Message-ID: 20131217161432.GO12902@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Pavel Stehule escribió:

> but AT TIME ZONE allows double (but decimal parts is ignored quietly)
>
> postgres=# select make_time(10,20,30) at time zone '+10.2';
> timezone
> -------------
> 23:20:30-10
>
> so I propose (and I implemented) a variant with int as time zone
>
> and we can (if we would) implement next one with text as time zone

Yeah, I think a constructor should allow a text timezone.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Jim Nasby <jim(at)nasby(dot)net>, Fabrízio Mello <fabriziomello(at)gmail(dot)com>, 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 16:46:10
Message-ID: 11812.1387298770@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> Yeah, I think a constructor should allow a text timezone.

Yes. I think a numeric timezone parameter is about 99% useless,
and if you do happen to need that behavior you can just cast the
numeric to text no?

regards, tom lane


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jim Nasby <jim(at)nasby(dot)net>, Fabrízio Mello <fabriziomello(at)gmail(dot)com>, 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 16:49:20
Message-ID: CAFj8pRAAVsGVWVLVPQFSzuhUniYyvSXLR-CT-Am=5y4QNfUT5w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2013/12/17 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>

> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> > Yeah, I think a constructor should allow a text timezone.
>
> Yes. I think a numeric timezone parameter is about 99% useless,
> and if you do happen to need that behavior you can just cast the
> numeric to text no?

yes, it is possible. Although fully numeric API is much more consistent.

Pavel

>
> regards, tom lane
>


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Jim Nasby <jim(at)nasby(dot)net>, 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 16:56:22
Message-ID: CAFj8pRB9nnWFWCPh+URK98wxvJrKChjU7i8wZz464=OjNdm0Hw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2013/12/17 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>

> Pavel Stehule escribió:
>
> > but AT TIME ZONE allows double (but decimal parts is ignored quietly)
> >
> > postgres=# select make_time(10,20,30) at time zone '+10.2';
> > timezone
> > -------------
> > 23:20:30-10
> >
> > so I propose (and I implemented) a variant with int as time zone
> >
> > and we can (if we would) implement next one with text as time zone
>
> Yeah, I think a constructor should allow a text timezone.
>

is there some simple way, how to parse text time zone?

Regards

Pavel

>
> --
> Álvaro Herrera http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jim Nasby <jim(at)nasby(dot)net>, Fabrízio Mello <fabriziomello(at)gmail(dot)com>, 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 17:07:38
Message-ID: CAFj8pRBfRSrMjctgM33oqZW9LOSc9DWM_Z8FHZ_4=R58BnY1=g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello

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

>
>
>
> 2013/12/17 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>
>> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
>> > Yeah, I think a constructor should allow a text timezone.
>>
>> Yes. I think a numeric timezone parameter is about 99% useless,
>> and if you do happen to need that behavior you can just cast the
>> numeric to text no?
>
>
> yes, it is possible. Although fully numeric API is much more consistent.
>
>
I was wrong - there are timezones with minutes like Iran = '1:30';

so int in hours is bad type - so only text is probably best

Pavel

> Pavel
>
>
>>
>> regards, tom lane
>>
>
>


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jim Nasby <jim(at)nasby(dot)net>, Fabrízio Mello <fabriziomello(at)gmail(dot)com>, 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 17:33:01
Message-ID: 20131217173301.GE19059@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Dec 17, 2013 at 06:07:38PM +0100, Pavel Stehule wrote:
> Hello
>
>
> 2013/12/17 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
>
>
>
>
> 2013/12/17 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>
> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> > Yeah, I think a constructor should allow a text timezone.
>
> Yes.  I think a numeric timezone parameter is about 99% useless,
> and if you do happen to need that behavior you can just cast the
> numeric to text no?
>
>
> yes, it is possible. Although fully numeric API is much more consistent.
>
>
>
> I was wrong - there are timezones with minutes like Iran = '1:30';
>
> so int in hours is bad type - so only text is probably best

I think India is the big non-integer timezone offset country:

http://www.timeanddate.com/worldclock/city.html?n=176
UTC/GMT +5:30 hours

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +


From: Michael Weber <mtweber(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jim Nasby <jim(at)nasby(dot)net>, Fabrízio Mello <fabriziomello(at)gmail(dot)com>, 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 17:46:57
Message-ID: CAFC8v6aR+BofbuA38TQProAsAgFEyVQO78uzsF92VSHYRpud2w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

There are also timezones off by 15 minutes (although only a few, mainly
Nepal).

The only integer representation I've ever seen is in 15 minutes units.

http://www.timeanddate.com/time/time-zones-interesting.html

On Tue, Dec 17, 2013 at 12:33 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:

> On Tue, Dec 17, 2013 at 06:07:38PM +0100, Pavel Stehule wrote:
> > Hello
> >
> >
> > 2013/12/17 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> >
> >
> >
> >
> > 2013/12/17 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> >
> > Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> > > Yeah, I think a constructor should allow a text timezone.
> >
> > Yes. I think a numeric timezone parameter is about 99% useless,
> > and if you do happen to need that behavior you can just cast the
> > numeric to text no?
> >
> >
> > yes, it is possible. Although fully numeric API is much more
> consistent.
> >
> >
> >
> > I was wrong - there are timezones with minutes like Iran = '1:30';
> >
> > so int in hours is bad type - so only text is probably best
>
> I think India is the big non-integer timezone offset country:
>
> http://www.timeanddate.com/worldclock/city.html?n=176
> UTC/GMT +5:30 hours
>
> --
> Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
> EnterpriseDB http://enterprisedb.com
>
> + Everyone has their own god. +
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jim Nasby <jim(at)nasby(dot)net>, Fabrízio Mello <fabriziomello(at)gmail(dot)com>, 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-18 08:09:54
Message-ID: CAFj8pRDbwEhEoNGcKx4ujXNuYucXqdpR=+SzJe4Jbv54VtmbHw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello

updated patch - optional time zone is as text.

postgres=# SELECT make_timetz(8, 15, 55.333) = '8:15:55.333'::timetz;
?column?
----------
t
(1 row)

postgres=# SELECT make_timetz(8, 15, 55.333, 'HKT') = '8:15:55.333
HKT'::timetz;
?column?
----------
t
(1 row)

postgres=# SELECT make_timetz(8, 15, 55.333, '+1:30') = '8:15:55.333
+1:30'::timetz;
?column?
----------
t
(1 row)

postgres=# SELECT make_timetz(8, 15, 55.333, '-1:30') = '8:15:55.333
-1:30'::timetz;
?column?
----------
t
(1 row)

Regards

Pavel

2013/12/17 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>

> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> > Yeah, I think a constructor should allow a text timezone.
>
> Yes. I think a numeric timezone parameter is about 99% useless,
> and if you do happen to need that behavior you can just cast the
> numeric to text no?
>
> regards, tom lane
>

Attachment Content-Type Size
make_timestamp-2013-12-18-01.patch text/x-patch 22.4 KB

From: Tomas Vondra <tv(at)fuzzy(dot)cz>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: patch: make_timestamp function
Date: 2014-01-11 19:38:34
Message-ID: 52D19DBA.8070400@fuzzy.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

I've done a quick review of this patch:

1) patch applies fine to the current HEAD, with a few hunks offset
by a few lines

2) the compilation fails because of duplicate OIDs in pg_proc, so
I had to change 3969-3975 to 4033-4039, then it compiles fine

3) make installcheck works fine

4) No regression tests for make_time / make_date.

5) The documentation is incomplete - make_date / make_time are missing.

6) The documentation should mention that when the 'timezone' parameter
is not set explicitly, the current timezone is used.

7) Why do the functions accept only the timezone abbreviation, not the
full name? I find it rather confusing, because the 'timezone' option
uses the full name, and we're using this as the default. But doing
'show timestamp' and using the returned value fails. Is it possible
to fix this somehow?

regards
Tomas


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Fwd: patch: make_timestamp function
Date: 2014-01-12 12:16:15
Message-ID: CAFj8pRBo_ugXy464OG9zmNLnsTLGfzA4We2SHjiq8HNCFODhEw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello

2014/1/11 Tomas Vondra <tv(at)fuzzy(dot)cz>

> Hi,
>
> I've done a quick review of this patch:
>
> 1) patch applies fine to the current HEAD, with a few hunks offset
> by a few lines
>
> 2) the compilation fails because of duplicate OIDs in pg_proc, so
> I had to change 3969-3975 to 4033-4039, then it compiles fine
>

fixed

>
> 3) make installcheck works fine
>
> 4) No regression tests for make_time / make_date.
>
> 5) The documentation is incomplete - make_date / make_time are missing.
>

two previous points are done by
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=f901bb50e33ad95593bb68f7b3b55eb2e47607dccommits.
This patch try to complete a ToDo entry.

>
> 6) The documentation should mention that when the 'timezone' parameter
> is not set explicitly, the current timezone is used.
>

fixed

>
> 7) Why do the functions accept only the timezone abbreviation, not the
> full name? I find it rather confusing, because the 'timezone' option
> uses the full name, and we're using this as the default. But doing
> 'show timestamp' and using the returned value fails. Is it possible
> to fix this somehow?
>

A only abbreviation is allowed for timetz type. Timestamp can work with
full time zone names. A rules (behave) should be same as input functions
for types: timestamptz and timetz.

postgres=# select '10:10:10 CET'::timetz;
timetz
─────────────
10:10:10+01
(1 row)

postgres=# select '10:10:10 Europe/Prague'::timetz;
ERROR: invalid input syntax for type time with time zone: "10:10:10
Europe/Prague"
LINE 1: select '10:10:10 Europe/Prague'::timetz;
^

This limit is due used routines limits.

postgres=# select make_timestamptz(2014, 12, 10, 10, 10, 10,
'America/Vancouver');
make_timestamptz
────────────────────────
2014-12-10 19:10:10+01
(1 row)

Time: 0.829 ms
postgres=# select '2014-12-10 10:10:10
America/Vancouver'::timestamptz; timestamptz
────────────────────────
2014-12-10 19:10:10+01
(1 row)

Time: 0.753 ms

I enhanced a regress tests. I found so work with time zones is not strongly
consistent in different use cases. Operator AT TIME ZONE is more tolerant,
but I use a routines used in input functions and my target was consistent
behave (and results) with input functions.

Regards

Pavel

>
>
>
> regards
> Tomas
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

Attachment Content-Type Size
make_timestamp-2014-01-01-01.patch text/x-patch 29.2 KB

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-01-25 18:09:41
Message-ID: 52E3FDE5.30906@joh.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Looks good to me.

Regards,
Marko Tiikkaja


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-02-19 18:01:04
Message-ID: 20140219180103.GB4759@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Pavel Stehule escribió:

> > 7) Why do the functions accept only the timezone abbreviation, not the
> > full name? I find it rather confusing, because the 'timezone' option
> > uses the full name, and we're using this as the default. But doing
> > 'show timestamp' and using the returned value fails. Is it possible
> > to fix this somehow?
>
> A only abbreviation is allowed for timetz type. Timestamp can work with
> full time zone names. A rules (behave) should be same as input functions
> for types: timestamptz and timetz.
>
> postgres=# select '10:10:10 CET'::timetz;
> timetz
> ─────────────
> 10:10:10+01
> (1 row)
>
> postgres=# select '10:10:10 Europe/Prague'::timetz;
> ERROR: invalid input syntax for type time with time zone: "10:10:10
> Europe/Prague"
> LINE 1: select '10:10:10 Europe/Prague'::timetz;
> ^
>
> This limit is due used routines limits.

I think this is a strange limitation, and perhaps it should be fixed
rather than inflicting the limitation on the new function.

I tweaked your patch a bit, attached; other than defining what to do
about full TZ names in timetz, this seems ready to commit.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
make_timestamp-2014-02-19-01.patch text/x-diff 29.0 KB

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-02-19 18:41:06
Message-ID: CAFj8pRADy1yxWaSj9-Cd2PxEjLu5ZEssb4rk1SLmKrkF-bobYA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2014-02-19 19:01 GMT+01:00 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:

> Pavel Stehule escribió:
>
> > > 7) Why do the functions accept only the timezone abbreviation, not the
> > > full name? I find it rather confusing, because the 'timezone' option
> > > uses the full name, and we're using this as the default. But doing
> > > 'show timestamp' and using the returned value fails. Is it possible
> > > to fix this somehow?
> >
> > A only abbreviation is allowed for timetz type. Timestamp can work with
> > full time zone names. A rules (behave) should be same as input functions
> > for types: timestamptz and timetz.
> >
> > postgres=# select '10:10:10 CET'::timetz;
> > timetz
> > ─────────────
> > 10:10:10+01
> > (1 row)
> >
> > postgres=# select '10:10:10 Europe/Prague'::timetz;
> > ERROR: invalid input syntax for type time with time zone: "10:10:10
> > Europe/Prague"
> > LINE 1: select '10:10:10 Europe/Prague'::timetz;
> > ^
> >
> > This limit is due used routines limits.
>
> I think this is a strange limitation, and perhaps it should be fixed
> rather than inflicting the limitation on the new function.
>
> I tweaked your patch a bit, attached; other than defining what to do
> about full TZ names in timetz, this seems ready to commit.
>

I have not a objection - thank you

Pavel

>
> --
> Álvaro Herrera http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-02-19 18:56:42
Message-ID: CAFj8pRDL4RpGmF6AKALB32qu-4O6iHjg_i=dAiUeGOdNekCuUQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2014-02-19 19:01 GMT+01:00 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:

> Pavel Stehule escribió:
>
> > > 7) Why do the functions accept only the timezone abbreviation, not the
> > > full name? I find it rather confusing, because the 'timezone' option
> > > uses the full name, and we're using this as the default. But doing
> > > 'show timestamp' and using the returned value fails. Is it possible
> > > to fix this somehow?
> >
> > A only abbreviation is allowed for timetz type. Timestamp can work with
> > full time zone names. A rules (behave) should be same as input functions
> > for types: timestamptz and timetz.
> >
> > postgres=# select '10:10:10 CET'::timetz;
> > timetz
> > ─────────────
> > 10:10:10+01
> > (1 row)
> >
> > postgres=# select '10:10:10 Europe/Prague'::timetz;
> > ERROR: invalid input syntax for type time with time zone: "10:10:10
> > Europe/Prague"
> > LINE 1: select '10:10:10 Europe/Prague'::timetz;
> > ^
> >
> > This limit is due used routines limits.
>
> I think this is a strange limitation, and perhaps it should be fixed
> rather than inflicting the limitation on the new function.
>

I though about it, and now I am thinking so timezone in format
'Europe/Prague' is together with time ambiguous

We can do it, but we have to expect so calculation will be related to
current date - and I am not sure if it is correct, because someone can
write some like

make_date(x,x,x) + make_timetz(..) - and result will be damaged.

>
> I tweaked your patch a bit, attached; other than defining what to do
> about full TZ names in timetz, this seems ready to commit.
>
> --
> Álvaro Herrera http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-02-19 20:20:09
Message-ID: 20140219202009.GC4759@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Pavel Stehule escribió:

> I though about it, and now I am thinking so timezone in format
> 'Europe/Prague' is together with time ambiguous
>
> We can do it, but we have to expect so calculation will be related to
> current date - and I am not sure if it is correct, because someone can
> write some like
>
> make_date(x,x,x) + make_timetz(..) - and result will be damaged.

Hmm, I see your point --- the make_timetz() call would use today's
timezone displacement, which might be different from the one used in the
make_date() result. That would result in a botched timestamptz
sometimes, but it might escape testing because it's subtle and depends
on the input data.

However, your proposal is to use an abbreviation timezone, thereby
forcing the user to select the correct timezone i.e. the one that
matches the make_date() arguments. I'm not sure this is much of an
improvement, because then the user is faced with the difficult problem
of figuring out the correct abbreviation in the first place.

I think there is little we can do to solve the problem at this level; it
seems to me that the right solution here is to instruct users to use
make_date() only in conjunction with make_time(), that is, produce a
timezone-less timestamp; and then apply a AT TIME ZONE operator to the
result. That could take a full timezone name, and that would always
work correctly.

My conclusion here is that the "time with time zone" datatype is broken
in itself, because of this kind of ambiguity. Maybe we should just
avoid offering more functionality on top of it, that is get rid of
make_timetz() in this patch?

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Tomáš Vondra <tv(at)fuzzy(dot)cz>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-02-19 20:31:18
Message-ID: CAFj8pRBuvDfp2ZCN_uCOnjyK5mN2dPgZ4TMK7gt6K8xcRFtp2A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Dne 19. 2. 2014 21:20 "Alvaro Herrera" <alvherre(at)2ndquadrant(dot)com> napsal(a):
>
> Pavel Stehule escribió:
>
> > I though about it, and now I am thinking so timezone in format
> > 'Europe/Prague' is together with time ambiguous
> >
> > We can do it, but we have to expect so calculation will be related to
> > current date - and I am not sure if it is correct, because someone can
> > write some like
> >
> > make_date(x,x,x) + make_timetz(..) - and result will be damaged.
>
> Hmm, I see your point --- the make_timetz() call would use today's
> timezone displacement, which might be different from the one used in the
> make_date() result. That would result in a botched timestamptz
> sometimes, but it might escape testing because it's subtle and depends
> on the input data.
>
> However, your proposal is to use an abbreviation timezone, thereby
> forcing the user to select the correct timezone i.e. the one that
> matches the make_date() arguments. I'm not sure this is much of an
> improvement, because then the user is faced with the difficult problem
> of figuring out the correct abbreviation in the first place.
>
> I think there is little we can do to solve the problem at this level; it
> seems to me that the right solution here is to instruct users to use
> make_date() only in conjunction with make_time(), that is, produce a
> timezone-less timestamp; and then apply a AT TIME ZONE operator to the
> result. That could take a full timezone name, and that would always
> work correctly.
>
> My conclusion here is that the "time with time zone" datatype is broken
> in itself, because of this kind of ambiguity. Maybe we should just
> avoid offering more functionality on top of it, that is get rid of
> make_timetz() in this patch?
>

+1

Pavel
> --
> Álvaro Herrera http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-02-19 21:15:21
Message-ID: 15019.1392844521@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> My conclusion here is that the "time with time zone" datatype is broken
> in itself, because of this kind of ambiguity.

That's the conclusion that's been arrived at by pretty much everybody
who's looked at it with any care.

> Maybe we should just
> avoid offering more functionality on top of it, that is get rid of
> make_timetz() in this patch?

+1. We don't need to encourage people to use that type.

regards, tom lane


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-02-20 08:17:42
Message-ID: CAFj8pRAYJWKZCZeiDmam5466WSsXGL_MfRwtqpqHPs4N1NbFyg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello

updated patch without timetz support

Regards

Pavel

2014-02-19 21:20 GMT+01:00 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:

> Pavel Stehule escribió:
>
> > I though about it, and now I am thinking so timezone in format
> > 'Europe/Prague' is together with time ambiguous
> >
> > We can do it, but we have to expect so calculation will be related to
> > current date - and I am not sure if it is correct, because someone can
> > write some like
> >
> > make_date(x,x,x) + make_timetz(..) - and result will be damaged.
>
> Hmm, I see your point --- the make_timetz() call would use today's
> timezone displacement, which might be different from the one used in the
> make_date() result. That would result in a botched timestamptz
> sometimes, but it might escape testing because it's subtle and depends
> on the input data.
>
> However, your proposal is to use an abbreviation timezone, thereby
> forcing the user to select the correct timezone i.e. the one that
> matches the make_date() arguments. I'm not sure this is much of an
> improvement, because then the user is faced with the difficult problem
> of figuring out the correct abbreviation in the first place.
>
> I think there is little we can do to solve the problem at this level; it
> seems to me that the right solution here is to instruct users to use
> make_date() only in conjunction with make_time(), that is, produce a
> timezone-less timestamp; and then apply a AT TIME ZONE operator to the
> result. That could take a full timezone name, and that would always
> work correctly.
>
> My conclusion here is that the "time with time zone" datatype is broken
> in itself, because of this kind of ambiguity. Maybe we should just
> avoid offering more functionality on top of it, that is get rid of
> make_timetz() in this patch?
>
> --
> Álvaro Herrera http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>

Attachment Content-Type Size
make_timestamp-2014-02-20-01.patch text/x-patch 22.9 KB

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-02-27 19:10:39
Message-ID: 20140227191039.GR4759@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Pavel Stehule escribió:
> Hello
>
> updated patch without timetz support

Great, thanks.

While testing, I noticed something strange regarding numeric timezone
specification. Basically the way any particular value is handled is
underspecified, or maybe just completely wacko. Consider the attached
function, which will try to construct a timestamptz value with all
possible values for timezone in the -1000 to 1000 range, ignoring those
that cause errors for whatever reason, and then subtract the obtained
timestamptz from the base value. The output is also attached.

First of all you can see that there are plenty of values for which the
constructor will simply fail.

Second, the way signs are considered or not seems arbitrary. Note that
if you say either '-2' or '2', you will end up with the same timestamptz
value. But at -16 the value jumps to the opposite sign.

For negative values, this continues up to -99; but at -100, apparently
it stops considering the value a number of hours, and it considers
hours-and-minutes with a missing colon separator. Which works up to
-159; at -160 and up to -167 it uses a different interpretation again
(not sure what). Then values -168 and below are not valid; -200 is
valid again (2 hours) For the rest of the interval,

For positive values, apparently there's no funny interpretation; the
number is taken to be a number of hours up to 167. There's no valid
value above that. However, if you prepend a plus sign, the result is
completely different and there are valid values up to +1559. The funny
behavior in +160 through +167 is there too.

Not sure what to make of this; certainly it's not my interest to fix it.
However I wonder if we should really offer the capability to pass
numeric timezone values. Seems it'd be saner to allow just symbolic
names, either abbreviations or full names.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
trytz.sql application/x-sql 438 bytes
output text/plain 36.1 KB

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-02-28 10:24:40
Message-ID: CAFj8pRCWR3b5oHvRKBr=6khTaFLq31u_2p57zxCxcQyiikBskg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2014-02-27 20:10 GMT+01:00 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:

> Pavel Stehule escribió:
> > Hello
> >
> > updated patch without timetz support
>
> Great, thanks.
>
> While testing, I noticed something strange regarding numeric timezone
> specification. Basically the way any particular value is handled is
> underspecified, or maybe just completely wacko. Consider the attached
> function, which will try to construct a timestamptz value with all
> possible values for timezone in the -1000 to 1000 range, ignoring those
> that cause errors for whatever reason, and then subtract the obtained
> timestamptz from the base value. The output is also attached.
>
> First of all you can see that there are plenty of values for which the
> constructor will simply fail.
>
> Second, the way signs are considered or not seems arbitrary. Note that
> if you say either '-2' or '2', you will end up with the same timestamptz
> value. But at -16 the value jumps to the opposite sign.
>
> For negative values, this continues up to -99; but at -100, apparently
> it stops considering the value a number of hours, and it considers
> hours-and-minutes with a missing colon separator. Which works up to
> -159; at -160 and up to -167 it uses a different interpretation again
> (not sure what). Then values -168 and below are not valid; -200 is
> valid again (2 hours) For the rest of the interval,
>
> For positive values, apparently there's no funny interpretation; the
> number is taken to be a number of hours up to 167. There's no valid
> value above that. However, if you prepend a plus sign, the result is
> completely different and there are valid values up to +1559. The funny
> behavior in +160 through +167 is there too.
>
> Not sure what to make of this; certainly it's not my interest to fix it.
> However I wonder if we should really offer the capability to pass
> numeric timezone values. Seems it'd be saner to allow just symbolic
> names, either abbreviations or full names.
>

I found a small issue. Routines for parsing time zone expects so time zone
starts with '+' or '-'. When this symbol is missing, then it use '-' as
default.

That is pretty stupid - probably it expects check in preprocessing

postgres=# select make_timestamptz(2014, 12, 10, 10, 10, 10, '-1');
make_timestamptz
------------------------
2014-12-10 12:10:10+01
(1 row)

postgres=# select make_timestamptz(2014, 12, 10, 10, 10, 10, '1');
make_timestamptz
------------------------
2014-12-10 12:10:10+01
(1 row)

postgres=# select make_timestamptz(2014, 12, 10, 10, 10, 10, '+1');
make_timestamptz
------------------------
2014-12-10 10:10:10+01
(1 row)

When I fix this, then make_timestamptz produce same results as timestamptz
input function.

CREATE OR REPLACE FUNCTION public.tryt1(integer)
RETURNS TABLE (tz int, tm01 timestamptz, tm02 timestamptz, diff interval)
LANGUAGE plpgsql
AS $function$
declare
tz int;
begin
for tz in - $1 .. $1 loop
begin
tryt1.tz = tz;
tm01 := format('1987-02-14 12:25:00 %s%s', CASE WHEN tz > 0 THEN
'+' ELSE '' END, tz)::timestamptz;
tm02 := make_timestamptz(1987, 2, 14, 12, 25, 00, CASE WHEN tz > 0
THEN '+' ELSE '' END || tz::text);
diff := tm02 - tm01;
return next;
exception when others then null;
raise notice 'error %s: %', SQLERRM, tz;
end;
end loop;
end;
$function$;

A allowed (or disallowed) numeric zones are little bit strange - but it is
different issue not related to this patch.

so still I prefer to allow numeric time zones.

What I can:

a) disallow numeric only timezone without prefix "+" or "-"

or

b) add "+" prefix to time zone, when number is possitive.

I prefer @a.

What do you thinking?

Regards

Pavel

>
> --
> Álvaro Herrera http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-02-28 14:11:17
Message-ID: 20140228141117.GT4759@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Pavel Stehule escribió:

> so still I prefer to allow numeric time zones.
>
> What I can:
>
> a) disallow numeric only timezone without prefix "+" or "-"
>
> or
>
> b) add "+" prefix to time zone, when number is possitive.
>
> I prefer @a.

I can live with (a) too. But I wonder if we should restrict the allowed
tz even further, for example to say that there must always be either 2
digits (no colon) or 4 digits, with or without a colon.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-03-02 09:59:29
Message-ID: CAFj8pRBPautQ2zRn6czRkN7gPcBFovb6UTg1HjiLt3nrunA6ZA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello

updated version - a precheck is very simple, and I what I tested it is
enough

Regards

Pavel

2014-02-28 15:11 GMT+01:00 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:

> Pavel Stehule escribió:
>
> > so still I prefer to allow numeric time zones.
> >
> > What I can:
> >
> > a) disallow numeric only timezone without prefix "+" or "-"
> >
> > or
> >
> > b) add "+" prefix to time zone, when number is possitive.
> >
> > I prefer @a.
>
> I can live with (a) too. But I wonder if we should restrict the allowed
> tz even further, for example to say that there must always be either 2
> digits (no colon) or 4 digits, with or without a colon.
>
> --
> Álvaro Herrera http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>

Attachment Content-Type Size
make_timestamp-2014-03-02-1.patch text/x-patch 23.9 KB

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-03-04 18:12:42
Message-ID: 20140304181242.GH4759@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Pavel Stehule escribió:
> Hello
>
> updated version - a precheck is very simple, and I what I tested it is
> enough

Okay, thanks. I pushed it after some more editorialization. I don't
think I broke anything, but please have a look.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-03-04 19:00:58
Message-ID: CAFj8pRB8BnGG2hmYRtUkGdBfJCySrSVuTSU6BHhG6+yOK5_igw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2014-03-04 19:12 GMT+01:00 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:

> Pavel Stehule escribió:
> > Hello
> >
> > updated version - a precheck is very simple, and I what I tested it is
> > enough
>
> Okay, thanks. I pushed it after some more editorialization. I don't
> think I broke anything, but please have a look.
>

It looks well

Thank you very much

Pavel

>
> --
> Álvaro Herrera http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-03-04 19:20:10
Message-ID: 20140304192010.GJ4759@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Pavel Stehule escribió:
> 2014-03-04 19:12 GMT+01:00 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:
>
> > Pavel Stehule escribió:
> > > Hello
> > >
> > > updated version - a precheck is very simple, and I what I tested it is
> > > enough
> >
> > Okay, thanks. I pushed it after some more editorialization. I don't
> > think I broke anything, but please have a look.
>
> It looks well

Coypu is showing a strange failure though:

http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=coypu&dt=2014-03-04%2018%3A22%3A31
select make_interval(secs := 'inf');
! make_interval
! ---------------------
! @ 0.000001 secs ago
! (1 row)

I realize that we have some hacks in float4in and float8in to deal with
these portability issues ... Maybe the fix is just take out the test.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-03-04 20:00:11
Message-ID: CAFj8pRCEYt-EnnnJYRE2EYV0BELM8OYo31KmhE-RZ5jUMAmHHw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2014-03-04 20:20 GMT+01:00 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:

> Pavel Stehule escribió:
> > 2014-03-04 19:12 GMT+01:00 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:
> >
> > > Pavel Stehule escribió:
> > > > Hello
> > > >
> > > > updated version - a precheck is very simple, and I what I tested it
> is
> > > > enough
> > >
> > > Okay, thanks. I pushed it after some more editorialization. I don't
> > > think I broke anything, but please have a look.
> >
> > It looks well
>
> Coypu is showing a strange failure though:
>
>
> http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=coypu&dt=2014-03-04%2018%3A22%3A31
> select make_interval(secs := 'inf');
> ! make_interval
> ! ---------------------
> ! @ 0.000001 secs ago
> ! (1 row)
>
> I realize that we have some hacks in float4in and float8in to deal with
> these portability issues ... Maybe the fix is just take out the test.
>
>
I have no idea, how to fix it now and have to leave a office. Tomorrow I'll
try to fix it.

Regards

Pavel

> --
> Álvaro Herrera http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-03-05 15:08:28
Message-ID: CAFj8pRBA0TBEaD_Fo9649Wd1HU9J_ijFU9h-8J5v=WUkqnX7Dw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi

I hope, so this patch fix it

Regards

Pavel

2014-03-04 21:00 GMT+01:00 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:

>
>
>
> 2014-03-04 20:20 GMT+01:00 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:
>
> Pavel Stehule escribió:
>> > 2014-03-04 19:12 GMT+01:00 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:
>> >
>> > > Pavel Stehule escribió:
>> > > > Hello
>> > > >
>> > > > updated version - a precheck is very simple, and I what I tested it
>> is
>> > > > enough
>> > >
>> > > Okay, thanks. I pushed it after some more editorialization. I don't
>> > > think I broke anything, but please have a look.
>> >
>> > It looks well
>>
>> Coypu is showing a strange failure though:
>>
>>
>> http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=coypu&dt=2014-03-04%2018%3A22%3A31
>> select make_interval(secs := 'inf');
>> ! make_interval
>> ! ---------------------
>> ! @ 0.000001 secs ago
>> ! (1 row)
>>
>> I realize that we have some hacks in float4in and float8in to deal with
>> these portability issues ... Maybe the fix is just take out the test.
>>
>>
> I have no idea, how to fix it now and have to leave a office. Tomorrow
> I'll try to fix it.
>
> Regards
>
> Pavel
>
>
>
>> --
>> Álvaro Herrera http://www.2ndQuadrant.com/
>> PostgreSQL Development, 24x7 Support, Training & Services
>>
>
>

Attachment Content-Type Size
fix.patch text/x-patch 1.4 KB

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-03-05 15:22:04
Message-ID: 20140305152204.GK4759@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Pavel Stehule escribió:
> Hi
>
> I hope, so this patch fix it

wtf?

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-03-06 06:26:23
Message-ID: CAFj8pRDaB1y9vyp=gtkUdvZ63JMgykvxxczZS8i+HtO8epHScQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2014-03-05 16:22 GMT+01:00 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:

> Pavel Stehule escribió:
> > Hi
> >
> > I hope, so this patch fix it
>
> wtf?
>

I tried to fix
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=f1ba94bcd9717b94b36868d6905547e313f3a359

Tom did it better than me.

Regards

Pavel

>
> --
> Álvaro Herrera http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-03-06 20:06:33
Message-ID: CA+TgmoZaymRKmJ2actvXZoLCcFZwjHzHHyu4zPCdvm1M2scQHA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Mar 6, 2014 at 1:26 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
> 2014-03-05 16:22 GMT+01:00 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:
>
>> Pavel Stehule escribió:
>> > Hi
>> >
>> > I hope, so this patch fix it
>>
>> wtf?
>
>
> I tried to fix
> http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=f1ba94bcd9717b94b36868d6905547e313f3a359
>
> Tom did it better than me.

The patch you attached was one from Heikki, not anything you wrote for
yourself, and utterly unrelated to the topic of this thread.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tomáš Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Fwd: patch: make_timestamp function
Date: 2014-03-06 20:21:04
Message-ID: CAFj8pRAmCmgQoMeNRHbY2Ok+MUwe-rEa9gVWAwbnWqeXiun5eQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2014-03-06 21:06 GMT+01:00 Robert Haas <robertmhaas(at)gmail(dot)com>:

> On Thu, Mar 6, 2014 at 1:26 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
> > 2014-03-05 16:22 GMT+01:00 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:
> >
> >> Pavel Stehule escribió:
> >> > Hi
> >> >
> >> > I hope, so this patch fix it
> >>
> >> wtf?
> >
> >
> > I tried to fix
> >
> http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=f1ba94bcd9717b94b36868d6905547e313f3a359
> >
> > Tom did it better than me.
>
> The patch you attached was one from Heikki, not anything you wrote for
> yourself, and utterly unrelated to the topic of this thread.
>
>
yes, sorry - it is some git issue on my side (I had to use wrong hash). I
did changes similar to Tom fix, but patch was some other than I did.

Regards

Pavel

> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>