all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Gerler <baron@bundesbrandschatzamt.de>
To: 23242@debbugs.gnu.org
Cc: Andreas Gerler <baron@bundesbrandschatzamt.de>
Subject: bug#23242: [PATCH] ob-sql.el: set PGPASSWORD environment
Date: Fri,  8 Apr 2016 10:24:22 +0000	[thread overview]
Message-ID: <1460111062-4420-1-git-send-email-baron@bundesbrandschatzamt.de> (raw)

* 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






             reply	other threads:[~2016-04-08 10:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-08 10:24 Andreas Gerler [this message]
2016-04-08 15:45 ` bug#23242: [PATCH] ob-sql.el: set PGPASSWORD environment Andreas Schwab
2017-06-14 23:57 ` npostavs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460111062-4420-1-git-send-email-baron@bundesbrandschatzamt.de \
    --to=baron@bundesbrandschatzamt.de \
    --cc=23242@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.