Re: factorial doc bug?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: lockhart(at)fourpalms(dot)org
Cc: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: factorial doc bug?
Date: 2001-09-16 20:18:45
Message-ID: 18782.1000671525@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thomas Lockhart <lockhart(at)fourpalms(dot)org> writes:
> Actually, it may be simply that we (now) implement factorial operators
> for int8, int4, and int2. Not sure what previous releases implemented,
> but perhaps it is just an issue of knowing which one should be used for
> the operation. If before we only had, say, int4, then the coersion code
> could easily assume that it was the correct coersion.

I think this must be the correct explanation. Observe this experiment:

regression=# create operator !! (procedure = int4fac, leftarg = int4);
CREATE
regression=# select 4.3 !!;
?column?
----------
24
(1 row)

regression=# create operator !! (procedure = int2fac, leftarg = int2);
CREATE
regression=# select 4.3 !!;
ERROR: Unable to identify a postfix operator '!!' for type 'double precision'
You may need to add parentheses or an explicit cast
regression=#

The int2 and int8 factorial operators were new in 7.0. The example in
the docs is older --- its claim that there's only one factorial op in
the catalogs is clearly out of date. So I'd say we should change the
example. Have we got any other operators that only come in an int4
flavor, and are likely to stay that way?

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-09-16 21:36:19 Re: factorial doc bug?
Previous Message Peter Eisentraut 2001-09-16 20:02:31 Re: Major change to CVS effective immediately ...