Convert to existing bash code pattern to run psql commands