Re: Analysis Function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Jarvis <thangalin(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Analysis Function
Date: 2010-06-11 20:20:55
Message-ID: 12241.1276287655@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

David Jarvis <thangalin(at)gmail(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message David Jarvis 2010-06-11 20:30:58 Re: Analysis Function
Previous Message Tim Landscheidt 2010-06-11 18:53:44 Re: Analysis Function