branch: externals-release/org commit 862048d4cb3bf93fb74832ed490c41faebb7d5b5 Author: Alan Light <lighta...@gmail.com> Commit: Kyle Meyer <k...@kyleam.com>
ob-sql.el: Respect the value of sql-postgres-program * ob-sql.el (org-babel-execute:sql): Use `sql-postgres-program' as postgresql executable (instead of psql) when defined. psql will be the default. [km: tweaked commit message, added bound-and-true-p guard] TINYCHANGE --- lisp/ob-sql.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el index 902194a..b9dd72b 100644 --- a/lisp/ob-sql.el +++ b/lisp/ob-sql.el @@ -245,11 +245,14 @@ This function is called by `org-babel-execute-src-block'." (org-babel-process-file-name in-file) (org-babel-process-file-name out-file))) ((postgresql postgres) (format - "%spsql --set=\"ON_ERROR_STOP=1\" %s -A -P \ + "%s%s --set=\"ON_ERROR_STOP=1\" %s -A -P \ footer=off -F \"\t\" %s -f %s -o %s %s" (if dbpassword (format "PGPASSWORD=%s " dbpassword) "") + (or (bound-and-true-p + sql-postgres-program) + "psql") (if colnames-p "" "-t") (org-babel-sql-dbstring-postgresql dbhost dbport dbuser database)