Hubert depesz Lubaczewski <depesz@depesz.pl> writes:
> i was thinking about using something like:
> CREATE type helper_login as (logged bool, username TEXT, points INT8,
> first_login bool, admin bool, last_login timestamptz, can_ask_questions
> bool, timeleft INTERVAL);
> CREATE OR REPLACE FUNCTION login(TEXT, TEXT, INT8) RETURNS helper_login
> AS '
> DECLARE
> in_username ALIAS FOR $1;
> in_password ALIAS FOR $2;
> in_quiz_id ALIAS FOR $3;
> reply helper_login;
You need to say reply helper_login%ROWTYPE;
otherwise plpgsql doesn't realize that this is supposed to be a rowtype
variable. (That could stand to be improved, but no one's gotten around
to it yet.) See
http://www.ca.postgresql.org/users-lounge/docs/7.3/postgres/plpgsql-declarations.html#PLPGSQL-DECLARATION-ROWTYPES
regards, tom lane