Execute a String Sql in PostgreSQL
postgresql
Solution
Inside a function use EXECUTE. http://www.postgresql.org/docs/current/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN
Problem
In a function, I have a `SELECT` query in a string, for example: ``` sql='SELECT * FROM A' ``` I want to execute `sql` output result of: `SELECT * FROM A` How can I execute the string `sql` in PostgreSQL?