comparing record and record problem if first rec is from function

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема comparing record and record problem if first rec is from function
Дата
Msg-id BAY20-F2157451E1F6820AD463708F96B0@phx.gbl
обсуждение исходный текст
Список pgsql-hackers
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/



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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: pgsql-patches considered harmful
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: pgsql-patches considered harmful