Re: [HACKERS] proposal: simple date constructor from numeric values

2013-11-17 Thread Tom Lane
Alvaro Herrera writes: > Thanks. I wasn't sure about the error message returned when times are > outside range; how about this instead? I'm not wedded to this approach > -- I can return to yours if this one isn't liked -- but I think the > more specific messages are better. I realize this is in

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-10-11 Thread Alvaro Herrera
Pavel Stehule escribió: > It was my mistake - I was confused from timestamp with time zone type, > what has zero related to date and time. > > fixed to immutable, > fixed duplicate oid Thanks. I wasn't sure about the error message returned when times are outside range; how about this instead?

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-10-11 Thread Pavel Stehule
Hello 2013/10/11 Alvaro Herrera > Jeevan Chalke escribió: > > On Wed, Sep 18, 2013 at 9:54 PM, Pavel Stehule >wrote: > > > > > thank you, > > > > > > I have no comments > > > > Assigned it to committer. > > Hm, these functions are marked as STABLE, right? Why aren't they > immutable? > It wa

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-10-11 Thread Alvaro Herrera
Jeevan Chalke escribió: > On Wed, Sep 18, 2013 at 9:54 PM, Pavel Stehule wrote: > > > thank you, > > > > I have no comments > > Assigned it to committer. Hm, these functions are marked as STABLE, right? Why aren't they immutable? -- Álvaro Herrerahttp://www.2ndQuadrant.com/ Po

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-09-18 Thread Jeevan Chalke
On Wed, Sep 18, 2013 at 9:54 PM, Pavel Stehule wrote: > Hello > > thank you, > > I have no comments > Thanks. Assigned it to committer. > > Regards > > Pavel > > -- Jeevan B Chalke

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-09-18 Thread Pavel Stehule
Hello thank you, I have no comments Regards Pavel 2013/9/18 Jeevan Chalke > Hi Pavel, > > I have reviewed your patch. > > Patch looks excellent and code changes match with similar constructs > elsewhere. That's great. > > However, it was not applying with git apply command but able to apply

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-09-17 Thread Jeevan Chalke
Hi Pavel, I have reviewed your patch. Patch looks excellent and code changes match with similar constructs elsewhere. That's great. However, it was not applying with git apply command but able to apply it with patch -p1 with some offsets. make and make install was smooth too. Regression suite di

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-09-17 Thread Alvaro Herrera
Pavel Stehule escribió: > fixed - see attached patch There's a typo "tange" in some error messages, which has found its way to the regression tests. -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hacker

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-07-13 Thread Pavel Stehule
Hello 2013/7/12 Peter Eisentraut : > There is a small inconsistency: > > select time '12:30:57.123456789'; > > gives > > 12:30:57.123457 > > but > > select make_time(12, 30, 57.123456789); > > gives > > 12:30:57.123456 fixed - see attached patch Regards Pavel > make_date-v3.patch Description

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-07-12 Thread Peter Eisentraut
There is a small inconsistency: select time '12:30:57.123456789'; gives 12:30:57.123457 but select make_time(12, 30, 57.123456789); gives 12:30:57.123456 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-07-08 Thread Pavel Stehule
Hello updated patch + more precious validity check Regards Pavel 2013/7/3 Pavel Stehule : > Hello > > >> So my vote is for make_time(hour int, min int, sec float8). >> > > so here is a patch > > Regards > > Pavel > > > >> regards, tom lane make_date-v2.patch Descripti

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-07-03 Thread Pavel Stehule
Hello > So my vote is for make_time(hour int, min int, sec float8). > so here is a patch Regards Pavel > regards, tom lane make_date.patch Description: Binary data -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subsc

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-07-03 Thread Pavel Stehule
2013/7/3 Tom Lane : > Alvaro Herrera writes: >> Peter Eisentraut escribió: >>> On 7/1/13 3:47 AM, Pavel Stehule wrote: CREATE OR REPLACE FUNCTION construct_time(hour int DEFAULT 0, mi int DEFAULT 0, sec int DEFAULT 0, ms float DEFAULT 0.0); >>> >>> If we are using integer datetime storag

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-07-03 Thread Tom Lane
Alvaro Herrera writes: > Peter Eisentraut escribió: >> On 7/1/13 3:47 AM, Pavel Stehule wrote: >>> CREATE OR REPLACE FUNCTION construct_time(hour int DEFAULT 0, mi int >>> DEFAULT 0, sec int DEFAULT 0, ms float DEFAULT 0.0); >> >> If we are using integer datetime storage, we shouldn't use floats

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-07-03 Thread Pavel Stehule
2013/7/3 Alvaro Herrera : > Peter Eisentraut escribió: >> On 7/1/13 3:47 AM, Pavel Stehule wrote: > >> > CREATE OR REPLACE FUNCTION construct_time(hour int DEFAULT 0, mi int >> > DEFAULT 0, sec int DEFAULT 0, ms float DEFAULT 0.0); >> >> If we are using integer datetime storage, we shouldn't use fl

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-07-03 Thread Alvaro Herrera
Peter Eisentraut escribió: > On 7/1/13 3:47 AM, Pavel Stehule wrote: > > CREATE OR REPLACE FUNCTION construct_time(hour int DEFAULT 0, mi int > > DEFAULT 0, sec int DEFAULT 0, ms float DEFAULT 0.0); > > If we are using integer datetime storage, we shouldn't use floats to > construct them. I thin

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-07-03 Thread Brendan Jurd
On 3 July 2013 21:41, Pavel Stehule wrote: > I am thinking so for these functions exists some consensus - minimally > for function "date"(year, month, int) - I dream about this function > ten years :) > > I am not sure about "datetime": > a) we use "timestamp" name for same thing in pg > b) we can

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-07-03 Thread Pavel Stehule
Hello 2013/7/3 Brendan Jurd : > On 1 July 2013 17:47, Pavel Stehule wrote: >> 2013/6/29 Pavel Stehule : >>> long time I am thinking about simple function for creating date or >>> timestamp values based on numeric types without necessity to create >>> format string. >>> >>> What do you think about

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-07-03 Thread Brendan Jurd
On 1 July 2013 17:47, Pavel Stehule wrote: > 2013/6/29 Pavel Stehule : >> long time I am thinking about simple function for creating date or >> timestamp values based on numeric types without necessity to create >> format string. >> >> What do you think about this idea? > I found so same idea was

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-07-03 Thread Pavel Stehule
2013/7/3 Pavel Stehule : > 2013/7/2 Pavel Stehule : >> 2013/7/1 Peter Eisentraut : >>> On 7/1/13 3:47 AM, Pavel Stehule wrote: and it is a part of our ToDo: "Add function to allow the creation of timestamps using parameters" so we can have a functions with signatures >>> >>> I w

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-07-03 Thread Pavel Stehule
2013/7/2 Pavel Stehule : > 2013/7/1 Peter Eisentraut : >> On 7/1/13 3:47 AM, Pavel Stehule wrote: >>> and it is a part of our ToDo: "Add function to allow the creation of >>> timestamps using parameters" >>> >>> so we can have a functions with signatures >> >> I would just name them date(...), time

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-07-02 Thread Pavel Stehule
2013/7/1 Peter Eisentraut : > On 7/1/13 3:47 AM, Pavel Stehule wrote: >> and it is a part of our ToDo: "Add function to allow the creation of >> timestamps using parameters" >> >> so we can have a functions with signatures > > I would just name them date(...), time(...), etc. > +1 >> CREATE OR RE

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-07-01 Thread Peter Eisentraut
On 7/1/13 3:47 AM, Pavel Stehule wrote: > and it is a part of our ToDo: "Add function to allow the creation of > timestamps using parameters" > > so we can have a functions with signatures I would just name them date(...), time(...), etc. > CREATE OR REPLACE FUNCTION construct_date(year int, mon

Re: [HACKERS] proposal: simple date constructor from numeric values

2013-07-01 Thread Pavel Stehule
Hello 2013/6/29 Pavel Stehule : > Hello > > long time I am thinking about simple function for creating date or > timestamp values based on numeric types without necessity to create > format string. > > some like ansi_date(year, month, day) and ansi_timestamp(year, month, > day, hour, minuts, sec,

[HACKERS] proposal: simple date constructor from numeric values

2013-06-29 Thread Pavel Stehule
Hello long time I am thinking about simple function for creating date or timestamp values based on numeric types without necessity to create format string. some like ansi_date(year, month, day) and ansi_timestamp(year, month, day, hour, minuts, sec, msec, offset) What do you think about this ide