On Wednesday 05 August 2009 19:59:52 Tom Lane wrote:
> Or maybe we are going at this the wrong way?  Would it be better to try
> harder to support the write-a-plpgsql-function approach?
This would become much simpler if you could just execute plpgsql code instead 
of having to define a function around it.  And perhaps if the plpgsql parser 
where a bit smarter.
Example:
RUN LANGUAGE plpgsql $$
FOR schema_name, table_name FROM information_schema.tables WHERE whatever LOOP   GRANT ALL ON TABLE
schema_name.table_nameTO someuser;
 
END LOOP $$;