From: Tom Lane <tgl@sss.pgh.pa.us>
To: PegoraroF10 <marcos@f10.com.br>
Cc: pgsql-general@postgresql.org
Subject: Re: Operator is not unique
Date: Tue, 24 Sep 2019 09:57:32 -0400
Message-ID: <13888.1569333452@sss.pgh.pa.us> (raw)
In-Reply-To: <1569332101700-0.post@n3.nabble.com>
References: <1569332101700-0.post@n3.nabble.com>
PegoraroF10 <marcos@f10.com.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, marcos@f10.com.br
Subject: Re: Operator is not unique
In-Reply-To: <13888.1569333452@sss.pgh.pa.us>
References: <1569332101700-0.post@n3.nabble.com> <13888.1569333452@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox