for row in select loop question - Mailing list pgsql-hackers

From Michael Davis
Subject for row in select loop question
Date
Msg-id 93C04F1F5173D211A27900105AA8FCFC145221@lambic.prevuenet.com
Whole thread Raw
Responses Re: [HACKERS] for row in select loop question
List pgsql-hackers
The following function does not work:

CREATE FUNCTION InstallPermissions(varchar, varchar) RETURNS int2 AS 'DECLARE                options ALIAS FOR $1;
usernameALIAS FOR $2;
 
BEGINFOR row IN select * from pg_tables LOOP            REVOKE ALL ON row.tablename FROM username;      GRANT options
onrow.tablename TO username;END LOOP;return 0;END; ' LANGUAGE 'plpgsql';
 

"select InstallPermissions('test1', 'test2);"  returns an error at "select".
Any suggestions on how to eliminate the error?

Thanks, Michael


pgsql-hackers by date:

Previous
From: Michael Davis
Date:
Subject: parser enhancement request for 6.5
Next
From: Tatsuo Ishii
Date:
Subject: Tom Lane's fixes in v6.4.3