Re: proposal: simple date constructor from numeric values - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: proposal: simple date constructor from numeric values
Date
Msg-id CAFj8pRAQM-F4pmH5WkoeFNbarWbRPVvdQc=_+=imk2OzKPHWVw@mail.gmail.com
Whole thread Raw
In response to proposal: simple date constructor from numeric values  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: proposal: simple date constructor from numeric values
Re: proposal: simple date constructor from numeric values
List pgsql-hackers
Hello


2013/6/29 Pavel Stehule <pavel.stehule@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, hour, minuts, sec, msec, offset)
>
> What do you think about this idea?
I found so same idea was discussed three years ago

http://www.postgresql.org/message-id/14107.1276443739@sss.pgh.pa.us

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

CREATE OR REPLACE FUNCTION construct_date(year int, month int DEFAULT
1, day int DEFAULT 1) RETURNS date;
CREATE OR REPLACE FUNCTION construct_time(hour int DEFAULT 0, mi int
DEFAULT 0, sec int DEFAULT 0, ms float DEFAULT 0.0);
CREATE OR REPLACE FUNCTION construct_timestap(year int, month int DEFAULT ....
CREATE OR REPLACE FUNCTION construct_timestamp_with_timezone(year int,
month int DEFAULT1, ...

???

Regards

Pavel Stehule

>
> Regards
>
> Pavel Stehule



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: plpython implementation
Next
From: Heikki Linnakangas
Date:
Subject: Re: Optimizing pglz compressor