From mboxrd@z Thu Jan 1 00:00:00 1970 From: Harri Kiiskinen Subject: [PATCH] Postgresql support for ob-sql.el Date: Wed, 15 Sep 2010 17:02:02 +0300 (EEST) Message-ID: <20100915.170202.401240283.harri.kiiskinen@utu.fi> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1910707921==" Return-path: Received: from [140.186.70.92] (port=59304 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OvsYx-0007UD-79 for emacs-orgmode@gnu.org; Wed, 15 Sep 2010 10:02:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OvsYv-0000XJ-SU for emacs-orgmode@gnu.org; Wed, 15 Sep 2010 10:02:14 -0400 Received: from smtp-03.utu.fi ([130.232.207.3]:53255) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OvsYv-0000Wl-MN for emacs-orgmode@gnu.org; Wed, 15 Sep 2010 10:02:13 -0400 Received: from localhost (dyn37-114.vpn.utu.fi [130.232.37.114]) by smtp-03.utu.fi (Sun Java(tm) System Messaging Server 7u3-17.01 64bit (built Jun 8 2010)) with ESMTPSA id <0L8S003IFKBMKD20@smtp-03.utu.fi> for emacs-orgmode@gnu.org; Wed, 15 Sep 2010 17:02:10 +0300 (EEST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --===============1910707921== Content-type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart0(Wed_Sep_15_17_02_02_2010_393)--" Content-transfer-encoding: 7bit ----Security_Multipart0(Wed_Sep_15_17_02_02_2010_393)-- Content-Type: Multipart/Mixed; boundary="--Next_Part(Wed_Sep_15_17_02_02_2010_065)--" Content-Transfer-Encoding: 7bit ----Next_Part(Wed_Sep_15_17_02_02_2010_065)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 harkiisk@gmail.com ----Next_Part(Wed_Sep_15_17_02_02_2010_065)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ob-sql.el.diff" 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))) ----Next_Part(Wed_Sep_15_17_02_02_2010_065)---- ----Security_Multipart0(Wed_Sep_15_17_02_02_2010_393)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEABECAAYFAkyQ0doACgkQ96/ytBLubNm+jwCgl6s6IsYG48zbYB9kirtkN+tY rGwAoK/Uno6ELI+pYzUL8shdbpRz9YE7 =R1Z5 -----END PGP SIGNATURE----- ----Security_Multipart0(Wed_Sep_15_17_02_02_2010_393)---- --===============1910707921== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============1910707921==--