Re: Thread safe connection-name mapping in ECPG. Is it

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>, shridhar(at)frodo(dot)hserus(dot)net, Michael Meskes <meskes(at)postgresql(dot)org>, Zeugswetter Andreas SB SD <ZeugswetterA(at)spardat(dot)at>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Thread safe connection-name mapping in ECPG. Is it
Date: 2004-03-07 14:46:52
Message-ID: 20040307144652.GA22118@1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)jabber(dot)org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 2004-03-07 14:58:47 Re: Thread safe connection-name mapping in ECPG. Is it
Previous Message Tom Lane 2004-03-07 03:49:32 Re: avg() for timestamp