Function: sql-comint-postgres
sql-comint-postgres is a byte-compiled function defined in sql.el.gz.
Signature
(sql-comint-postgres PRODUCT OPTIONS &optional BUF-NAME)
Documentation
Create comint buffer and connect to Postgres.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/sql.el.gz
(defun sql-comint-postgres (product options &optional buf-name)
"Create comint buffer and connect to Postgres."
;; username and password are ignored. Mark Stosberg suggests to add
;; the database at the end. Jason Beegan suggests using --pset and
;; pager=off instead of \\o|cat. The later was the solution by
;; Gregor Zych. Jason's suggestion is the default value for
;; sql-postgres-options.
(let ((params
(append
(if (not (= 0 sql-port))
(list "-p" (number-to-string sql-port)))
(if (not (string= "" sql-user))
(list "-U" sql-user))
(if (not (string= "" sql-server))
(list "-h" sql-server))
options
(if (not (string= "" sql-database))
(list sql-database)))))
(sql-comint product params buf-name)))