Обсуждение: comparing record and record problem if first rec is from function

Поиск
Список
Период
Сортировка

comparing record and record problem if first rec is from function

От
"Pavel Stehule"
Дата:
Hello

I have problem with expressions:

select (select row(ret_num,ret_den) from mp.x_numer(39,32)) = row(32,33);
select mp.x_numer(39,32)) = row(32,33);

both has error:
ERROR:  operator does not exist: record = record
LINE 1: ...lect row(ret_num,ret_den) from mp.x_numer(39,32)) = row(32,3...
             ^
 
HINT:  No operator matches the given name and argument type(s). You may need 
to add explicit type casts.

CREATE OR REPLACE FUNCTION mp.x_numer(numer integer, denom integer, OUT 
ret_num integer, OUT ret_den integer) AS $$
BEGIN ret_num := numer + 1; ret_den := denom * 2; WHILE floor( ret_num/2 ) = ret_num/2.0 LOOP   ret_num := ret_num/2;
ret_den:= ret_den/2; END LOOP; RETURN;
 
END;
$$ LANGUAGE plpgsql IMMUTABLE;
SELECT mp.x_numer(39,32); --> 5,8;

What can be problem?

I use csv version of postgresql

regards
Pavel Stehule

_________________________________________________________________
Najdete si svou lasku a nove pratele na Match.com. http://www.msn.cz/