I have a function that I want to return setof a table in plpgsql. Here is what I have:
CREATE FUNCTION lookup_account(varchar(32)) RETURNS SETOF accounts AS ' DECLARE aname ALIAS FOR $1; rec RECORD; BEGIN select into rec * from accounts where accountname = aname; return rec; END;' LANGUAGE 'plpgsql'; This seems to hang when I attempt to select it using: select accountid( lookup_account('some account')), accountname(lookup_account('some account')), type(lookup_account('some account')), balance(lookup_account('some account')); Does anyone see a problem w/ my approach?? ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])