Postgres Function Execute Query String Definition