Re: ECPG, threading and pooling

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Shridhar Daithankar <shridhar_daithankar(at)persistent(dot)co(dot)in>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ECPG, threading and pooling
Date: 2003-01-23 19:06:29
Message-ID: 20030123190629.GA9207@feivel.fam-meskes.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Thu, Jan 23, 2003 at 08:58:24PM +0530, Shridhar Daithankar wrote:
> Well, when using libpq, I create a pool of PGconn*. What pool I create with
> ecpg? Looking at ecpglib.h, it seems that I need to create a pool of char *

Yes. You use it as EXEC SQL AT :connection_var SELECT ...

> That is correct but I did not find any example of how to use a particular
> connection in an SQL statement. It would be a fairly trivial guess that the
> connection name is one of the arguments to ECPGdo. But how the SQL statement
> look like, I don't have a clue. Also I don't know know how to use ECPGsetconn
> to set a connection. No documentation on that.

You don't call either one yourself. Let ecpg do that job. Some of the
test cases in the source tree use AT. Just look under .../ecpg/test.

> I can guess that ECPG maintains a mapping between connection name and PGconn*
> object for a user. If possible it would be very helpful to form a ecpg
> connection on top a user supplied PGconn* object.

Why? It's possible, but you have to work with structures not meant to be
used outside the lib.

Michael
--
Michael Meskes
Email: Michael(at)Fam-Meskes(dot)De
ICQ: 179140304
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message mlw 2003-01-23 19:50:03 Re: Threads
Previous Message Dave Cramer 2003-01-23 18:49:23 pgsql-server/src/interfaces/jdbc/org/postgresq ...

Browse pgsql-patches by date

  From Date Subject
Next Message Andy Kriger 2003-01-23 19:23:30 Re: question about rollback and SQLException
Previous Message Peter Eisentraut 2003-01-23 18:33:44 Re: [PATCHES] targetlist functions part 1 (was targetlist