comparing record and record problem if first rec is from function - Mailing list pgsql-hackers

From Pavel Stehule
Subject comparing record and record problem if first rec is from function
Date
Msg-id BAY20-F2157451E1F6820AD463708F96B0@phx.gbl
Whole thread Raw
List 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 by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: pgsql-patches considered harmful
Next
From: Josh Berkus
Date:
Subject: Re: pgsql-patches considered harmful