Table name as a PostgreSQL function parameter
Before you go there: for only few, known tables names, it’s typically simpler to avoid dynamic SQL and spell out the few code variants in separate functions or in a CASE construct. That said, what you are trying to achieve can be simplified and improved: CREATE OR REPLACE FUNCTION some_f(_tbl regclass, OUT result integer) LANGUAGE … Read more