Major refactor: add support for all Postgres commands