How To Return a Row or Result Set - Mailing list pgsql-novice

From Ketema Harris
Subject How To Return a Row or Result Set
Date
Msg-id 983b67500602010826t442e948aw83fa3f84818f5a1a@mail.gmail.com
Whole thread Raw
List pgsql-novice
I believe i figured it out...

CREATE OR REPLACE FUNCTION "public"."recruiting_login" (_username
varchar, _password varchar) RETURNS setof credentials AS
'
    declare
        user_creds credentials;
    begin
        if _password = (select "password" from recruiting_users where
username = _username) then
            select into user_creds user_id, "admin" from
recruiting_users where username = _username;
        else
            select into user_creds 0, false from recruiting_users;
        end if;
        return next user_creds;
    end;
'
LANGUAGE 'plpgsql'

is the best and correct way to Return a Row or Result Set?

pgsql-novice by date:

Previous
From: Ketema Harris
Date:
Subject: How To Return a Row or Result Set
Next
From: Gan Uesli Starling
Date:
Subject: Reverting from subtables to no subtables.