]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
ob-sql: patch for postgresql
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Fri, 8 Apr 2016 12:05:33 +0000 (14:05 +0200)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Fri, 8 Apr 2016 12:05:33 +0000 (14:05 +0200)
- patched dbpassword for babel-sql database postgresql. Sent patch to
  upstream. Set's environment variable for psql command. Without it no
  password login unless configured in psql configuration file.

elpa/org-20160215/ob-sql.el

index f096572e2aea376cbf90b488f4d0e93936884611..1a5c55174f1ca978686dcca598d851a7f729c8ff 100644 (file)
@@ -137,7 +137,8 @@ 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 footer=off -F \"\t\"  %s -f %s -o %s %s"
+                                 "%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)
                                  (org-babel-process-file-name in-file)