Re: proposal: simple date constructor from numeric values

From: Brendan Jurd <direvus(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: simple date constructor from numeric values
Date: 2013-07-03 10:08:36
Message-ID: CADxJZo26qe9xjJYSpTU-zCMMU+PQOEBQ5R9rB=2S9m9Bf6T-Gw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1 July 2013 17:47, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
> 2013/6/29 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)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 this idea?
> I found so same idea was discussed three years ago
>
> http://www.postgresql.org/message-id/14107.1276443739@sss.pgh.pa.us
>

I suggested something similar also:

http://www.postgresql.org/message-id/AANLkTi=W1wtcL7qR4PuQaQ=UoabmjSUSz6QGJTUCXF-P@mail.gmail.com

The thread I linked died off without reaching a consensus about what
the functions ought to be named, although Josh and Robert were
generally supportive of the idea.

The function signatures I have been using in my own C functions are:

* date(year int, month int, day int) returns date
* datetime(year int, month int, day int, hour int, minute int, second
int) returns timestamp

Cheers,
BJ

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message MauMau 2013-07-03 10:22:48 [9.3 bug fix] ECPG does not escape backslashes
Previous Message Pavel Stehule 2013-07-03 09:23:17 Re: proposal: simple date constructor from numeric values