modified with pg_execute