Re: [HACKERS] patch: make_timestamp function

2014-01-11 Thread Tomas Vondra
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)

Re: [HACKERS] patch: make_timestamp function

2013-12-18 Thread Pavel Stehule
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_time

Re: [HACKERS] patch: make_timestamp function

2013-12-17 Thread Michael Weber
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 wrote: > On Tue, Dec 17, 2013 at 0

Re: [HACKERS] patch: make_timestamp function

2013-12-17 Thread Bruce Momjian
On Tue, Dec 17, 2013 at 06:07:38PM +0100, Pavel Stehule wrote: > Hello > > > 2013/12/17 Pavel Stehule > > > > > 2013/12/17 Tom Lane > > Alvaro Herrera writes: > > Yeah, I think a constructor should allow a text timezone. > > Yes.  I think a numeric timezone pa

Re: [HACKERS] patch: make_timestamp function

2013-12-17 Thread Pavel Stehule
Hello 2013/12/17 Pavel Stehule > > > > 2013/12/17 Tom Lane > >> Alvaro Herrera 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 >> n

Re: [HACKERS] patch: make_timestamp function

2013-12-17 Thread Pavel Stehule
2013/12/17 Alvaro Herrera > 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

Re: [HACKERS] patch: make_timestamp function

2013-12-17 Thread Pavel Stehule
2013/12/17 Tom Lane > Alvaro Herrera 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

Re: [HACKERS] patch: make_timestamp function

2013-12-17 Thread Tom Lane
Alvaro Herrera 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 -- Sent via pgsql-

Re: [HACKERS] patch: make_timestamp function

2013-12-17 Thread Alvaro Herrera
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

Re: [HACKERS] patch: make_timestamp function

2013-12-17 Thread Pavel Stehule
2013/12/17 Jim Nasby > 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. >> >> >>

Re: [HACKERS] patch: make_timestamp function

2013-12-17 Thread Jim Nasby
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 forma

Re: [HACKERS] patch: make_timestamp function

2013-12-17 Thread Pavel Stehule
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_timestampt

Re: [HACKERS] patch: make_timestamp function

2013-12-15 Thread Pavel Stehule
Hello 2013/12/13 Jim Nasby > On 12/13/13 1:49 PM, Fabrízio de Royes Mello wrote: > >> >> On Fri, Dec 13, 2013 at 5:35 PM, Tom Lane > t...@sss.pgh.pa.us>> wrote: >> >> > >> > =?ISO-8859-1?Q?Fabr=EDzio_de_Royes_Mello?= >> > fabriziome...@gmail.com>> writes: >> > > I think the goal of the "mak

Re: [HACKERS] patch: make_timestamp function

2013-12-13 Thread Jim Nasby
On 12/13/13 1:49 PM, Fabrízio de Royes Mello wrote: On Fri, Dec 13, 2013 at 5:35 PM, Tom Lane mailto:t...@sss.pgh.pa.us>> wrote: > > =?ISO-8859-1?Q?Fabr=EDzio_de_Royes_Mello?= mailto:fabriziome...@gmail.com>> writes: > > I think the goal of the "make_date/time/timestamp" function series is bu

Re: [HACKERS] patch: make_timestamp function

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

Re: [HACKERS] patch: make_timestamp function

2013-12-13 Thread Fabrízio de Royes Mello
On Fri, Dec 13, 2013 at 5:35 PM, Tom Lane wrote: > > =?ISO-8859-1?Q?Fabr=EDzio_de_Royes_Mello?= 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 wit

Re: [HACKERS] patch: make_timestamp function

2013-12-13 Thread Tom Lane
=?ISO-8859-1?Q?Fabr=EDzio_de_Royes_Mello?= 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

Re: [HACKERS] patch: make_timestamp function

2013-12-13 Thread Fabrízio de Royes Mello
On Fri, Dec 13, 2013 at 3:53 PM, Martijn van Oosterhout 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 wrote: > > > > > Hello > > > > > > this patch try to complete a set of functions make_date and make_timesta

Re: [HACKERS] patch: make_timestamp function

2013-12-13 Thread Martijn van Oosterhout
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 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 th

Re: [HACKERS] patch: make_timestamp function

2013-12-13 Thread Fabrízio de Royes Mello
On Fri, Dec 13, 2013 at 7:09 AM, Pavel Stehule 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' setti

Re: [HACKERS] patch: make_timestamp function

2013-12-13 Thread Pavel Stehule
2013/12/12 Fabrízio de Royes Mello > > On Thu, Dec 12, 2013 at 3:11 PM, Pavel Stehule 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 question

Re: [HACKERS] patch: make_timestamp function

2013-12-12 Thread Fabrízio de Royes Mello
On Thu, Dec 12, 2013 at 3:11 PM, Pavel Stehule 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