Re: Operator is not unique

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: PegoraroF10 <marcos(at)f10(dot)com(dot)br>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Operator is not unique
Date: 2019-09-24 13:57:32
Message-ID: 13888.1569333452@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

PegoraroF10 <marcos(at)f10(dot)com(dot)br> writes:
> If I do ...
> select 1::NUMERIC + 1::BIGINT;
> I get ...
> [42725] ERROR: operator is not unique: numeric + bigint Hint: Could not
> choose a best candidate operator. You might need to add explicit type casts.

This doesn't happen for me.

> This error means I have more than one way to calculate that formula ?
> Did I create that operator erroneously ?

A more likely theory is that you made some ill-advised changes to casting
rules. If, say, the bigint to numeric and numeric to bigint casts are
both marked implicit, the parser won't have any way to decide whether it
should use "numeric + numeric" or "bigint + bigint" here.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Fabrízio de Royes Mello 2019-09-24 14:01:18 Re: Operator is not unique
Previous Message PegoraroF10 2019-09-24 13:51:49 Re: Operator is not unique