Found small issue with OUT params
От | Tony Caduto |
---|---|
Тема | Found small issue with OUT params |
Дата | |
Msg-id | 433AEAA7.1060004@amsoftwaredesign.com обсуждение исходный текст |
Ответы |
Re: Found small issue with OUT params
|
Список | pgsql-hackers |
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
В списке pgsql-hackers по дате отправления: