Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iClJy-0004DZ-7w for pgsql-general@arkaria.postgresql.org; Tue, 24 Sep 2019 13:57:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iClJx-0007kH-1n for pgsql-general@arkaria.postgresql.org; Tue, 24 Sep 2019 13:57:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iClJw-0007k8-Li for pgsql-general@lists.postgresql.org; Tue, 24 Sep 2019 13:57:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iClJu-0006JV-H6 for pgsql-general@postgresql.org; Tue, 24 Sep 2019 13:57:35 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x8ODvWqT013889; Tue, 24 Sep 2019 09:57:32 -0400 From: Tom Lane To: PegoraroF10 cc: pgsql-general@postgresql.org Subject: Re: Operator is not unique In-reply-to: <1569332101700-0.post@n3.nabble.com> References: <1569332101700-0.post@n3.nabble.com> Comments: In-reply-to PegoraroF10 message dated "Tue, 24 Sep 2019 06:35:01 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13887.1569333452.1@sss.pgh.pa.us> Date: Tue, 24 Sep 2019 09:57:32 -0400 Message-ID: <13888.1569333452@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PegoraroF10 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