From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [PATCH] Postgresql support for ob-sql.el Date: Fri, 17 Sep 2010 13:18:11 -0400 Message-ID: <87iq2447cc.fsf@gmail.com> References: <20100915.170202.401240283.harri.kiiskinen@utu.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=43750 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OweZm-0002bh-L7 for emacs-orgmode@gnu.org; Fri, 17 Sep 2010 13:18:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OweZj-0002SE-Ix for emacs-orgmode@gnu.org; Fri, 17 Sep 2010 13:18:18 -0400 Received: from mail-yw0-f41.google.com ([209.85.213.41]:51339) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OweZj-0002Rx-Gh for emacs-orgmode@gnu.org; Fri, 17 Sep 2010 13:18:15 -0400 Received: by ywl5 with SMTP id 5so1229039ywl.0 for ; Fri, 17 Sep 2010 10:18:14 -0700 (PDT) In-Reply-To: <20100915.170202.401240283.harri.kiiskinen@utu.fi> (Harri Kiiskinen's message of "Wed, 15 Sep 2010 17:02:02 +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: Harri Kiiskinen Cc: emacs-orgmode@gnu.org 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 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 > harkiisk@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