Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rm73y-0064qY-II for pgsql-general@arkaria.postgresql.org; Mon, 18 Mar 2024 07:05:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rm73w-00GHNW-AS for pgsql-general@arkaria.postgresql.org; Mon, 18 Mar 2024 07:05:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rm73v-00GHNO-NU for pgsql-general@lists.postgresql.org; Mon, 18 Mar 2024 07:05:36 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rm73r-0056NG-Uu for pgsql-general@lists.postgresql.org; Mon, 18 Mar 2024 07:05:34 +0000 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1df01161b39so15219915ad.3 for ; Mon, 18 Mar 2024 00:05:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fincuro-com.20230601.gappssmtp.com; s=20230601; t=1710745531; x=1711350331; darn=lists.postgresql.org; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=MyrIWr0ZqGI15di3LWVSBB0toToG4EsyF1WpbtTJrho=; b=Wn3wUH+fVSIhbGBS8wDxnEl3sZO4+z6r6a84SmBnsU4H/OqbWscinrGY2KefoXwR7e bkBljsvsD3tAsASolO0QWv+WdDaM9qwZJPBND01O4uuVdOlzLnNLpiHql8zLdHXWK/tg B29a3COk0ZOe8mUHQ6Snj5ZfV2CMQsxtyK3P8+x98rAjRUgR68ykO6RTj1fsZfOagmNM Q9ZBn2zoVEHQRTvXrJjFQ1Jj7F8ylTbY/7O+flzvO4OeQ3pp/bzQlRVWwgru4J/S1wOA n5bVQhDFuaqN0ZGsa9WIpXUMYmQ9DxwuhE5SPwF+QbogY5M0hqi4ZOuxX+cBOpURSO8T f49Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710745531; x=1711350331; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=MyrIWr0ZqGI15di3LWVSBB0toToG4EsyF1WpbtTJrho=; b=LV+HrXdl7TwQAk4ntzamF+2+iqP+hTuydTux/9fAS8HrBnelrjKTniaemnAaJwIQt5 k9SFKw5dWdvzS056BrW7HV/xPXqyXOxK4E6jfOuE6rmEjIcd62+7eq63QJ0gdJXt5ZJm NrGv9PGmdcpeUep5+bWQ9c9F3hE4rUp8Ljy9FZrXLDh49CAepZ5RCneGRIvZdY+8ff1R h+ifE7ZuA8gUIGXP4VXWf//ISEbCX2yaBwHyrKF9etyLWXvloeb63rPyQscWrho8F0Vd +ZuHHZrl6RuYucOe/MjctoaoSpBefky/UKE7LTVmI7LQzHvWwlKwyZiZh0K5meuFjYH8 FUxQ== X-Gm-Message-State: AOJu0YzGdoExpjs8lYC8F8IpXrnWLc47OB8oBl3O4cmLJnZ2Yz5AcQXV qQ1De+uV0tpCGZ7Fe9Jlk9bejLfZRVar+JoTS11hyvxU6xXOD9yTU9OxJ40azJY= X-Google-Smtp-Source: AGHT+IElPO5qog6e2NuRxO079RCe46DHSMl7CE4IBVuGM5dFWrVoQv+BVAnaxUtfKZdBWSvj3QgdSg== X-Received: by 2002:a17:903:32d0:b0:1de:fe62:5462 with SMTP id i16-20020a17090332d000b001defe625462mr10137031plr.8.1710745531548; Mon, 18 Mar 2024 00:05:31 -0700 (PDT) Received: from [172.26.200.9] ([49.205.149.243]) by smtp.gmail.com with ESMTPSA id u2-20020a1709026e0200b001dc0d1fb3b1sm8419340plk.58.2024.03.18.00.05.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Mar 2024 00:05:31 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------1XLudV5WPlq5qwqOANXbbujg" Message-ID: <5884c2c6-d46b-4ead-b089-2572848b02a1@fincuro.com> Date: Mon, 18 Mar 2024 12:35:27 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: operator is only a shell - Error Content-Language: en-US To: Greg Sabino Mullane Cc: pgsql-general@lists.postgresql.org References: <7f97243d-db62-199a-8412-5637963d117e@fincuro.com> From: Rajesh S In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------1XLudV5WPlq5qwqOANXbbujg Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Thank you for your response.  Actually, I was trying to address the following query. select LIEN_AC_NO from deposit_lien where deposit_no='0002114029832' and deposit_sub_no='1' and unlien_dt is null and unlien_remarks is null; In the above query "deposit_sub_no" column is "numeric" type and passing '1' (as varchar).  To address this I'd created the function and operator as I'd mentioned in the earlier mail.  Even the following query throws error after creating the function and operator. select * from deposit_lien where deposit_no='0002114029832'; ERROR: operator is only a shell: character varying = numeric LINE 1: select * from deposit_lien where deposit_no='0002114029832' ^ SQL state: 42883 Character: 44 In the above query "deposit_no" column is having "varchar" data type.  But before creating the function and operator it was working fine.  Tried dropping the same, even though the same error.  How to proceed now? Thanks, Rajesh S On 15-03-2024 19:10, Greg Sabino Mullane wrote: > On Fri, Mar 15, 2024 at 6:26 AM Rajesh S wrote: > > I wanted to implement a new "=" (equal) operator with LEFTARG as > numeric and RIGHTARG as varchar.  But after creating the function > and operator, psql shows the error "operator is only a shell: > character varying = numeric > > Your operator has numeric on the left and varchar on the right. But > your query is doing numeric on the RIGHT. Probably want to make a > matching one to cover both cases. > > Cheers, > Greg > --------------1XLudV5WPlq5qwqOANXbbujg Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Thank you for your response.=C2=A0 Actually, I was trying to addre= ss the following query.

select LIEN_AC_NO from deposit_lien where deposit_no=3D'0002114029832' and deposit_sub_no=3D'1' and unlien_dt= is null and unlien_remarks is null;

In the above query "deposit_sub_no" column is "numeric" type and passing '1' (as varchar).=C2=A0 To address this I'd created the function and operator as I'd mentioned in the earlier mail.=C2=A0 E= ven the following query throws error after creating the function and operator.

select * from deposit_lien where deposit_no=3D'0002114029832';

=

ERROR: operator is only a shell: character varying =3D numeric LINE 1: select * from deposit_lien where deposit_no=3D'0002114029832' ^=20 SQL state: 42883 Character: 44

In the above query "deposit_no" column is having "varchar" data type.=C2=A0 But before creating the function and operator it was working fine.=C2=A0 Tried dropping the same, even though the same error.=C2=A0 How to proceed now?


Thanks,

Rajesh S

=C2=A0

=C2=A0

On 15-03-2024 19:10, Greg Sabino Mullane wrote:
On Fri, Mar 15, 2024 at 6:26=E2=80=AFAM Rajesh S= <rajesh.s@fincuro.com> wrote:

I wanted to implement a new "=3D" (equal) operator with LEFTARG as numeric and RIGHTARG as varchar.=C2=A0 But aft= er creating the function and operator, psql shows the error "operator is only a shell: character varying =3D numeric

Your operator has numeric on the left and varchar on the right. But your query is doing numeric on the RIGHT. Probably want to make a matching one to cover both cases.

Cheers,
Greg

--------------1XLudV5WPlq5qwqOANXbbujg--