Postgres Function Execute Query String