Re: Analysis Function - Mailing list pgsql-performance

From Tom Lane
Subject Re: Analysis Function
Date
Msg-id 12241.1276287655@sss.pgh.pa.us
Whole thread Raw
In response to Re: Analysis Function  (David Jarvis <thangalin@gmail.com>)
Responses Re: Analysis Function  (David Jarvis <thangalin@gmail.com>)
List pgsql-performance
David Jarvis <thangalin@gmail.com> writes:
> dateserial(PG_FUNCTION_ARGS) {
>   int32 p_year = (int32)PG_GETARG_FLOAT8(0);
>   int32 p_month = PG_GETARG_INT32(1);
>   int32 p_day = PG_GETARG_INT32(2);

Er ... why float?  Integer is plenty for the range of years supported by
the PG datetime infrastructure.  The above coding is pretty lousy in terms
of its roundoff and overflow behavior, too.

            regards, tom lane

pgsql-performance by date:

Previous
From: Tim Landscheidt
Date:
Subject: Re: Analysis Function
Next
From: David Jarvis
Date:
Subject: Re: Analysis Function