Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D53246323A0 for ; Mon, 23 Feb 2009 21:47:34 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 67381-07 for ; Mon, 23 Feb 2009 21:47:31 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id E7542632214 for ; Mon, 23 Feb 2009 21:47:30 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n1O1lSGD029892; Mon, 23 Feb 2009 20:47:28 -0500 (EST) To: Bob Henkel cc: pgsql-interfaces@postgresql.org Subject: Re: C Stored Function with ECPG In-reply-to: References: Comments: In-reply-to Bob Henkel message dated "Mon, 23 Feb 2009 19:04:04 -0600" Date: Mon, 23 Feb 2009 20:47:28 -0500 Message-ID: <29891.1235440048@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200902/7 X-Sequence-Number: 6858 Bob Henkel writes: > I assume it's feasible to embedd ECPG in a Postgres Stored function > written in C? No, I don't think so; or at least that's not the expected usage. ECPG expects to connect to an external server. The normal way to issue SQL from C-level backend code is to use the SPI interface: http://www.postgresql.org/docs/8.3/static/spi.html regards, tom lane