Browse Source

add --set=\"ON_ERROR_STOP=1\" to psql execution

  Thanks to Joost Helberg for suggesting this change.

* lisp/ob-sql.el (org-babel-execute:sql): Add
  --set=\"ON_ERROR_STOP=1\" to psql execution.
Eric Schulte 11 years ago
parent
commit
baa44f6542
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lisp/ob-sql.el

+ 1 - 1
lisp/ob-sql.el

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