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

2013-11-17 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com 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.

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 pavel.steh...@gmail.comwrote: thank you, I have no comments Assigned it to committer. Hm, these functions are marked as STABLE, right? Why aren't they immutable? -- Álvaro Herrera

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

2013-10-11 Thread Pavel Stehule
Hello 2013/10/11 Alvaro Herrera alvhe...@2ndquadrant.com Jeevan Chalke escribió: On Wed, Sep 18, 2013 at 9:54 PM, Pavel Stehule pavel.steh...@gmail.com wrote: thank you, I have no comments Assigned it to committer. Hm, these functions are marked as STABLE, right? Why

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? I'm

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

2013-09-19 Thread Jeevan Chalke
On Wed, Sep 18, 2013 at 9:54 PM, Pavel Stehule pavel.steh...@gmail.comwrote: 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 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

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 jeevan.cha...@enterprisedb.com 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

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

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

2013-07-13 Thread Pavel Stehule
Hello 2013/7/12 Peter Eisentraut pete...@gmx.net: 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

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:

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 pavel.steh...@gmail.com: 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

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

2013-07-03 Thread Pavel Stehule
2013/7/2 Pavel Stehule pavel.steh...@gmail.com: 2013/7/1 Peter Eisentraut pete...@gmx.net: 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

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

2013-07-03 Thread Pavel Stehule
2013/7/3 Pavel Stehule pavel.steh...@gmail.com: 2013/7/2 Pavel Stehule pavel.steh...@gmail.com: 2013/7/1 Peter Eisentraut pete...@gmx.net: 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

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

2013-07-03 Thread Brendan Jurd
On 1 July 2013 17:47, Pavel Stehule pavel.steh...@gmail.com wrote: 2013/6/29 Pavel Stehule pavel.steh...@gmail.com: 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 Pavel Stehule
Hello 2013/7/3 Brendan Jurd dire...@gmail.com: On 1 July 2013 17:47, Pavel Stehule pavel.steh...@gmail.com wrote: 2013/6/29 Pavel Stehule pavel.steh...@gmail.com: long time I am thinking about simple function for creating date or timestamp values based on numeric types without necessity to

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

2013-07-03 Thread Brendan Jurd
On 3 July 2013 21:41, Pavel Stehule pavel.steh...@gmail.com 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

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

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

2013-07-03 Thread Pavel Stehule
2013/7/3 Alvaro Herrera alvhe...@2ndquadrant.com: 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

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

2013-07-03 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com 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

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

2013-07-03 Thread Pavel Stehule
2013/7/3 Tom Lane t...@sss.pgh.pa.us: Alvaro Herrera alvhe...@2ndquadrant.com 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

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

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

2013-07-02 Thread Pavel Stehule
2013/7/1 Peter Eisentraut pete...@gmx.net: 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: [HACKERS] proposal: simple date constructor from numeric values

2013-07-01 Thread Pavel Stehule
Hello 2013/6/29 Pavel Stehule pavel.steh...@gmail.com: 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,

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, month int