Dino Vliet <dino_vliet@xxxxxxxxx> writes: > I trying for days to get this simple plpgsql procedure > to run but I keep getting this error: You can't ordinarily use a variable to supply a table (or field) name in a plpgsql query; that doesn't work because plpgsql wants to cache a plan for the query. A workaround is to build the query as a string value, then use EXECUTE. regards, tom lane