Emacs comes with a built-in sql-mode that provides syntax highlighting and integration with databases, including PostgreSQL. If you want more PostgreSQL-specific features, you might consider third-party packages like pgsql mode.
Steps: Enable sql-mode or pgsql-mode in Emacs when editing .sql files: (add-to-list 'auto-mode-alist '("\.sql\'" . sql-mode)) For PostgreSQL-specific customizations: (setq sql-postgres-program "psql") ; Use PostgreSQL client