浏览代码

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.
Harri Kiiskinen 14 年之前
父节点
当前提交
52052e837a
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      lisp/ob-sql.el

+ 2 - 0
lisp/ob-sql.el

@@ -66,6 +66,8 @@ This function is called by `org-babel-execute-src-block'."
          (command (case (intern engine)
                     ('mysql (format "mysql %s -e \"source %s\" > %s"
                                     (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)))))
     (with-temp-file in-file
       (insert (org-babel-expand-body:sql body params)))