Re: Bug #534: factorial function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: j(dot)richter(at)wallstreet-develop(dot)de, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug #534: factorial function
Date: 2001-12-10 15:16:35
Message-ID: 18290.1007997395@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Yep, 0! sure looks like a bug. We will fix it in 7.3. Not sure about
> the double precision. Comments?

It looks like we have three versions of factorial, for int2 int4 and
int8. The version taking int2 is just plain wasted code space (perhaps
it predates the availability of automatic type conversions?) The int4
and int8 versions both have a serious problem with lack of overflow
detection. I'd be sorely tempted to replace all three by a single
function that takes integer and returns numeric.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Janko F. Richter 2001-12-10 15:34:10 Re: Bug #534: factorial function
Previous Message Tom Lane 2001-12-10 14:36:20 Re: Bug #531: libpq: Operations following PQfinish() work.