Re: Infinity vs Error for division by zero - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Infinity vs Error for division by zero
Date
Msg-id 25026.1551479653@sss.pgh.pa.us
Whole thread Raw
In response to Re: Infinity vs Error for division by zero  (Chapman Flack <chap@anastigmatix.net>)
Responses Re: Infinity vs Error for division by zero
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Proving IS NOT NULL inference for ScalarArrayOpExpr's
Next
From: Tom Lane
Date:
Subject: Re: NOT IN subquery optimization