Outdated example in documentation

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Outdated example in documentation
Дата
Msg-id Pine.LNX.4.44.0302241752080.2108-100000@peter.localdomain
обсуждение исходный текст
Ответы Re: Outdated example in documentation  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
User's Guide section 7.2, example 7-1, claims that

SELECT 2 ^ 3 AS "Exp";

will be equivalent, after type resolution, to

SELECT CAST(2 AS double precision) ^ CAST(3 AS double precision) AS "Exp";

(which is true) or

SELECT 2.0 ^ 3.0 AS "Exp";

which is not true, since 2.0 and 3.0 are nowadays of type numeric.  Rather
than deleting the third branch of this claim (which would also imply
deleting the subsequent Note), does anyone want to think of a new example?

Related observations:  The premise of the example is that the operator ^
only exists for double precision arguments.  ^ is implemented using SQL
function dpow, which is implemented using C function dpow.  There's also a
documented SQL function pow, which is implemented using C function dpow.
Wouldn't it be enough to have the documented SQL function pow and the
operator on top of that?

There's also a documented SQL function pow for "numeric", but no operator
for it.  Should that be added?

-- 
Peter Eisentraut   peter_e@gmx.net



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

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: ILIKE
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: ILIKE