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