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