For loop with dynamic table name in Postgresql 9.1?
问题 I have a plpgslq function which does some data processing and would like to write a for loop, however my table name is not known at design time. Is there any possible way to achieve this? Here is sample code snippet of what I want to achieve: -- Function: check_data() -- DROP FUNCTION check_data(); CREATE OR REPLACE FUNCTION check_data() RETURNS character varying AS $BODY$declare dyn_rec record; tbl_name record; begin -- sample dynamic tables tbl_name := 'cars'; tbl_name := 'trucks'; tbl_name