Re: Infinity vs Error for division by zero

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Infinity vs Error for division by zero
Дата
Msg-id 25026.1551479653@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Infinity vs Error for division by zero  (Chapman Flack <chap@anastigmatix.net>)
Ответы Re: Infinity vs Error for division by zero
Список pgsql-hackers
Chapman Flack <chap@anastigmatix.net> writes:
> I wanted to try this out a little before assuming it would work,
> and there seems to be no trouble creating a trivial domain over
> float8 (say, CREATE DOMAIN ieeedouble AS float8), and then creating
> operators whose operand types are the domain type.

While you can do that to some extent, you don't have a lot of control
over when the parser will use your operator --- basically, it'll only
do so if both inputs are exact type matches.  Maybe that'd be enough
but I think it'd be fragile to use.  (See the "Type Conversion"
chapter in the manual for the gory details, and note that domains
get smashed to their base types mighty readily.)

Using custom operator names would work better/more reliably.

            regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Proving IS NOT NULL inference for ScalarArrayOpExpr's
Следующее
От: Tom Lane
Дата:
Сообщение: Re: NOT IN subquery optimization