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?

Edit
Report