Found small issue with OUT params
- From: Tony Caduto <tony_caduto(at)amsoftwaredesign(dot)com>
- To: pgsql-hackers(at)postgreSQL(dot)org
- Subject: Found small issue with OUT params
- Date: Wed, 28 Sep 2005 14:10:31 -0500
- Message-id: <433AEAA7(dot)1060004(at)amsoftwaredesign(dot)com>
Hi,
consider this function:
CREATE OR REPLACE FUNCTION FIND_USER_SOCKET_BYNAME (
IN IN_USERNAME VARCHAR,
OUT OUT_SOCKET_ADDRESS INTEGER)
AS
$BODY$
BEGIN
select socket_address from userdata where fullname = in_username into
out_socket_address;
if out_socket_address is null then
out_socket_address = 0 ;
end if;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE
If I call it like this:
select * from FIND_USER_SOCKET_BYNAME('juser');
I would expect to get back 1 value with the name of the OUT param
(OUT_SOCKET_ADDRESS).
However it comes back with the name of the function which I would expect
if I called it like this:
select FIND_USER_SOCKET_BYNAME('juser');
If I add another OUT value then the value comes back with the name of
the out param(plus the temp one I added) as expected.
It's easy enough to work around, but was not as expected.
Thanks,
Tony Caduto
Home |
Main Index |
Thread Index