Re: Thread safe connection-name mapping in ECPG. Is it - Mailing list pgsql-hackers

From Michael Meskes
Subject Re: Thread safe connection-name mapping in ECPG. Is it
Date
Msg-id 20040307144652.GA22118@1
Whole thread Raw
In response to Re: Thread safe connection-name mapping in ECPG. Is it  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
On Wed, Mar 03, 2004 at 08:47:50AM -0500, Bruce Momjian wrote:
> > But yeah, specifying the connection by variable (be it string or
> > connection ptr) would be a definite step forward. Currently you cannot
> > write a generic function like:
> > 
> >  int getit(char *using_connection)
> >  {
> >   EXEC SQL BEGIN DECLARE SECTION;
> >   char *s_connection = using_connection;
> >   int s_it;
> >   EXEC SQL END DECLARE SECTION;
> > 
> >   EXEC SQL AT :s_connection SELECT it INTO :s_it FROM some_table;
> >   return( s_it );
> >  }
> > 
> > which could be run concurrently by multiple threads.

Why? What doesn't work? AFAIRC the AT statement does indeed allow a
variable as connection_target.

Michael
-- 
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: avg() for timestamp
Next
From: Michael Meskes
Date:
Subject: Re: Thread safe connection-name mapping in ECPG. Is it