all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#23242: [PATCH] ob-sql.el: set PGPASSWORD environment
@ 2016-04-08 10:24 Andreas Gerler
  2016-04-08 15:45 ` Andreas Schwab
  2017-06-14 23:57 ` npostavs
  0 siblings, 2 replies; 3+ messages in thread
From: Andreas Gerler @ 2016-04-08 10:24 UTC (permalink / raw
  To: 23242; +Cc: Andreas Gerler

* postgresql: set environment variable PGPASSWORD if dbpassword was supplied
---
 lisp/ob-sql.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
index 6488afe..bd3a51e 100644
--- a/lisp/ob-sql.el
+++ b/lisp/ob-sql.el
@@ -141,8 +141,9 @@ 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 (format
-				  "psql --set=\"ON_ERROR_STOP=1\" %s -A -P \
+				  "%s psql --set=\"ON_ERROR_STOP=1\" %s -A -P \
 footer=off -F \"\t\"  %s -f %s -o %s %s"
+				  (if dbpassword (concat "PGPASSWORD='" dbpassword "'") "")
 				  (if colnames-p "" "-t")
 				  (org-babel-sql-dbstring-postgresql
 				   dbhost dbuser database)
-- 
2.4.5






^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-14 23:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-08 10:24 bug#23242: [PATCH] ob-sql.el: set PGPASSWORD environment Andreas Gerler
2016-04-08 15:45 ` Andreas Schwab
2017-06-14 23:57 ` npostavs

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.