Re: factorial doc bug?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: factorial doc bug?
Дата
Msg-id 18782.1000671525@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: factorial doc bug?  (Thomas Lockhart <lockhart@fourpalms.org>)
Список pgsql-hackers
Thomas Lockhart <lockhart@fourpalms.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
anexplicit 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Major change to CVS effective immediately ...
Следующее
От: Tom Lane
Дата:
Сообщение: Re: factorial doc bug?