ob-sql: support for postgresql

It achieves this in the same way the mysql support is done, by using
  the psql client with suitable command line arguments.
This commit is contained in:
Harri Kiiskinen 2010-09-17 13:06:45 -04:00 committed by Eric Schulte
parent c19a04ec9f
commit 52052e837a
1 changed files with 2 additions and 0 deletions

View File

@ -66,6 +66,8 @@ This function is called by `org-babel-execute-src-block'."
(command (case (intern engine) (command (case (intern engine)
('mysql (format "mysql %s -e \"source %s\" > %s" ('mysql (format "mysql %s -e \"source %s\" > %s"
(or cmdline "") in-file out-file)) (or cmdline "") in-file out-file))
('postgresql (format "psql -A -P footer=off -F \"\t\" -f %s -o %s %s"
in-file out-file (or cmdline "")))
(t (error "no support for the %s sql engine" engine))))) (t (error "no support for the %s sql engine" engine)))))
(with-temp-file in-file (with-temp-file in-file
(insert (org-babel-expand-body:sql body params))) (insert (org-babel-expand-body:sql body params)))