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