Avoid "could not determine interpretation of row comparisonoperator ="
От | Voillequin, Jean-Marc |
---|---|
Тема | Avoid "could not determine interpretation of row comparisonoperator =" |
Дата | |
Msg-id | 1EC8157EB499BF459A516ADCF135ADCE39FFD3A4@LON-WGMSX712.ad.moodys.net обсуждение исходный текст |
Ответы |
Re: Avoid "could not determine interpretation of row comparison operator ="
|
Список | pgsql-sql |
Hello,
When I run the following sql:
create or replace function cmp_numeric_text(a numeric, b text) returns boolean as $$ select a=b::numeric;$$ language sql strict immutable;
create operator = (leftarg = numeric, rightarg = text, procedure = cmp_numeric_text);
select 'OK' where (1,2) in (select '1'::text,'2'::text);
I get:
ERROR: could not determine interpretation of row comparison operator =
LINE 1: select 'OK' where (1,2) in (select '1'::text,'2'::text);
^
HINT: Row comparison operators must be associated with btree operator families.
I understand that row (1,2) (int,int) cannot be compared to row (‘1’,’2’) (text,text) without coding a new comparison operator = for row type.
I have read the documentation on “create/alter operator class/family” but could not figure out how to do this.
Is it just possible to implement such feature within PG thanks to operator class/family ?
Of course, the case I have to solve is more complex. But a small example or recommendation will be greatly appreciated.
Thanks.
Regards.
This email was sent to you by Moody’s Investors Service EMEA Limited
Registered office address:
One Canada Square
Canary Wharf
London, E14 5FA
Registered in England and Wales No: 8922701
В списке pgsql-sql по дате отправления: