Re: [Orgmode] [PATCH] Postgresql support for ob-sql.el

2010-09-17 Thread Eric Schulte
Thanks Harri!

I've just applied this patch to the repository.

If you think you'll want to contribute patches longer than 10 lines
please consider the FSF assignment process described at
http://orgmode.org/worg/org-contribute.php

Thanks -- Eric

Harri Kiiskinen harri.kiiski...@utu.fi writes:

 The attaches patch adds support to postgresql to ob-sql.el

 It achieves this in the same way the mysql support is done, by using
 the psql client with suitable command line arguments.

 Best,

 Harri Kiiskinen
 harki...@gmail.com

 diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
 index 4e1daa5..2636752 100644
 --- a/lisp/ob-sql.el
 +++ b/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)))
 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] [PATCH] Postgresql support for ob-sql.el

2010-09-15 Thread Harri Kiiskinen
The attaches patch adds support to postgresql to ob-sql.el

It achieves this in the same way the mysql support is done, by using
the psql client with suitable command line arguments.

Best,

Harri Kiiskinen
harki...@gmail.com

diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
index 4e1daa5..2636752 100644
--- a/lisp/ob-sql.el
+++ b/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)))


pgpPHCWkVFbUW.pgp
Description: PGP signature
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode