Re: operator is only a shell - Error

Поиск
Список
Период
Сортировка
От Rajesh S
Тема Re: operator is only a shell - Error
Дата
Msg-id 5884c2c6-d46b-4ead-b089-2572848b02a1@fincuro.com
обсуждение исходный текст
Ответ на Re: operator is only a shell - Error  (Greg Sabino Mullane <htamfids@gmail.com>)
Ответы Re: operator is only a shell - Error
Re: operator is only a shell - Error
Список pgsql-general

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 <rajesh.s@fincuro.com> 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

В списке pgsql-general по дате отправления:

Предыдущее
От: PetSerAl
Дата:
Сообщение: Single-User Mode oid assignment
Следующее
От: Marc Millas
Дата:
Сообщение: ldap fdw