Browse Source

update psql command to respect :colnames

Suggested by Joost Helberg on the Mailing list.

TINYCHANGE

* lisp/ob-sql.el (org-babel-execute:sql): Update psql command to
  respect :colnames.
Eric Schulte 7 years ago
parent
commit
8285763b97
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lisp/ob-sql.el

+ 2 - 1
lisp/ob-sql.el

@@ -123,7 +123,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\" -A -P footer=off -F \"\t\"  -f %s -o %s %s"
+				  "psql --set=\"ON_ERROR_STOP=1\" %s -A -P footer=off -F \"\t\"  -f %s -o %s %s"
+				  (if colnames-p "" "-t")
 				  (org-babel-process-file-name in-file)
 				  (org-babel-process-file-name out-file)
 				  (or cmdline "")))