Boilerplate for working with pg_sql