| From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> | 
|---|---|
| To: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> | 
| Cc: | Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | Re: proposal: simple date constructor from numeric values | 
| Date: | 2013-07-03 16:43:35 | 
| Message-ID: | CAFj8pRDJo628j_Qj1PvceHLToGWT-rFRfxt4pqe9M71ggrcxNg@mail.gmail.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
2013/7/3 Alvaro Herrera <alvherre(at)2ndquadrant(dot)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 shouldn't use floats to
>> construct them.
>
> I think this is wrong.  Datetime storage may be int, but since they're
> microseconds underneath, we'd be unable to specify a full-resolution
> timestamp if we didn't have float ms or integer µs.  So either the
> seconds argument should allow fractions (probably not a good idea), or
> we should have another integer argument for microseconds (not
> milliseconds as the above signature implies).
so make_time(hour int, mi int, sec int, usec int DEFAULT 0)
Is good for all ?
Regards
Pavel
>
> --
> Álvaro Herrera                http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2013-07-03 17:03:38 | Re: proposal: simple date constructor from numeric values | 
| Previous Message | Robert Haas | 2013-07-03 16:36:26 | Re: Add regression tests for COLLATE |