[database] Run PostgreSQL queries from the command line