Skip site navigation (1) Skip section navigation (2)

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: 2005-09-28 19:10:31
Message-ID: 433AEAA7.1060004@amsoftwaredesign.com (view raw or flat)
Thread:
Lists: 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



Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2005-09-28 19:46:59
Subject: Re: Found small issue with OUT params
Previous:From: Tom LaneDate: 2005-09-28 19:00:50
Subject: Re: [PATCHES] Proposed patch for sequence-renaming problems

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group