Thanks to visit codestin.com
Credit goes to www.postgresql.org

Feature Description

RETURN QUERY EXECUTE

allows for returning the result of a dynamically generated query