Re: operator is only a shell - Error

2024-03-19 Thread Adrian Klaver
On 3/19/24 00:02, Rajesh S wrote: Sorry Adrian, my bad. I'd mentioned "deposit_sub_no='1'" by mistake, actually it was "deposit_sub_no=cast(1 as varchar)". This was throwing 1) Maybe you could explain the logic of taking a number and casting it to a string to compare it to a number? 2) sele

Re: operator is only a shell - Error

2024-03-19 Thread Rajesh S
Sorry Adrian, my bad. I'd mentioned "deposit_sub_no='1'" by mistake, actually it was "deposit_sub_no=cast(1 as varchar)". This was throwing error "SQL Error [42883]: ERROR: operator does not exist: numeric = character varying  Hint: No operator matches the given name and argument types. You mig

Re: operator is only a shell - Error

2024-03-18 Thread Adrian Klaver
On 3/18/24 00:05, Rajesh S wrote: 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

Re: operator is only a shell - Error

2024-03-18 Thread Greg Sabino Mullane
The order of the arguments matter. You need an operator that expects a varchar on the left hand side of the operator, and numeric on the right side. For example: create database cast_test; \c cast_test You are now connected to database "cast_test" as user "greg". cast_test=# create table deposit_

Re: operator is only a shell - Error

2024-03-18 Thread Rajesh S
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 p

Re: operator is only a shell - Error

2024-03-15 Thread Greg Sabino Mullane
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

operator is only a shell - Error

2024-03-15 Thread Rajesh S
Hi, 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 LINE 1: ...lect LIEN_AC_NO from deposit_lien where deposit_no='00021