Re: Fwd: [HACKERS] patch: make_timestamp function

2014-03-06 Thread Pavel Stehule
2014-03-06 21:06 GMT+01:00 Robert Haas : > On Thu, Mar 6, 2014 at 1:26 AM, Pavel Stehule > wrote: > > 2014-03-05 16:22 GMT+01:00 Alvaro Herrera : > > > >> Pavel Stehule escribió: > >> > Hi > >> > > >> > I hope, so this patch fix it > >> > >> wtf? > > > > > > I tried to fix > > > http://git.postgr

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-03-06 Thread Robert Haas
On Thu, Mar 6, 2014 at 1:26 AM, Pavel Stehule wrote: > 2014-03-05 16:22 GMT+01:00 Alvaro Herrera : > >> 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=f1ba94bcd9717b94b36868d

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-03-05 Thread Pavel Stehule
2014-03-05 16:22 GMT+01:00 Alvaro Herrera : > 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 > >

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-03-05 Thread Alvaro Herrera
Pavel Stehule escribió: > Hi > > I hope, so this patch fix it wtf? -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-03-05 Thread Pavel Stehule
Hi I hope, so this patch fix it Regards Pavel 2014-03-04 21:00 GMT+01:00 Pavel Stehule : > > > > 2014-03-04 20:20 GMT+01:00 Alvaro Herrera : > > Pavel Stehule escribió: >> > 2014-03-04 19:12 GMT+01:00 Alvaro Herrera : >> > >> > > Pavel Stehule escribió: >> > > > Hello >> > > > >> > > > update

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-03-04 Thread Pavel Stehule
2014-03-04 20:20 GMT+01:00 Alvaro Herrera : > Pavel Stehule escribió: > > 2014-03-04 19:12 GMT+01:00 Alvaro Herrera : > > > > > Pavel Stehule escribió: > > > > Hello > > > > > > > > updated version - a precheck is very simple, and I what I tested it > is > > > > enough > > > > > > Okay, thanks. I

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-03-04 Thread Alvaro Herrera
Pavel Stehule escribió: > 2014-03-04 19:12 GMT+01:00 Alvaro Herrera : > > > 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

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-03-04 Thread Pavel Stehule
2014-03-04 19:12 GMT+01:00 Alvaro Herrera : > 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. > I

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-03-04 Thread Alvaro Herrera
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 Herrerahttp://www.2ndQuadrant.com/

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-03-02 Thread Pavel Stehule
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 : > Pavel Stehule escribió: > > > so still I prefer to allow numeric time zones. > > > > What I can: > > > > a) disallow numeric only timezone without

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-02-28 Thread Alvaro Herrera
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 r

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-02-28 Thread Pavel Stehule
2014-02-27 20:10 GMT+01:00 Alvaro Herrera : > 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 > undersp

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-02-27 Thread Alvaro Herrera
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 attache

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-02-20 Thread Pavel Stehule
Hello updated patch without timetz support Regards Pavel 2014-02-19 21:20 GMT+01:00 Alvaro Herrera : > 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 s

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-02-19 Thread Tom Lane
Alvaro Herrera 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 fu

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-02-19 Thread Pavel Stehule
Dne 19. 2. 2014 21:20 "Alvaro Herrera" 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 - an

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-02-19 Thread Alvaro Herrera
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 som

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-02-19 Thread Pavel Stehule
2014-02-19 19:01 GMT+01:00 Alvaro Herrera : > 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 d

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-02-19 Thread Pavel Stehule
2014-02-19 19:01 GMT+01:00 Alvaro Herrera : > 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 d

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-02-19 Thread Alvaro Herrera
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 va

Re: Fwd: [HACKERS] patch: make_timestamp function

2014-01-25 Thread Marko Tiikkaja
Looks good to me. Regards, Marko Tiikkaja -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Fwd: [HACKERS] patch: make_timestamp function

2014-01-12 Thread Pavel Stehule
Hello 2014/1/11 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 co

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

[HACKERS] patch: make_timestamp function

2013-12-12 Thread Pavel Stehule
Hello this patch try to complete a set of functions make_date and make_timestamp. Regards Pavel commit a1344a0624f87438e2a12c0a7263a0e6dc9a1a30 Author: Pavel Stehule Date: Thu Dec 12 18:08:47 2013 +0100 initial implementation make_timestamp diff --git a/doc/src/sgml/func.sgml b/doc/src/