fixed code snippets for psql