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

From Shridhar Daithankar
Subject Re: Thread safe connection-name mapping in ECPG. Is it
Date
Msg-id 200402272059.10660.shridhar@frodo.hserus.net
Whole thread Raw
In response to Re: Thread safe connection-name mapping in ECPG. Is it  (Michael Meskes <meskes@postgresql.org>)
Responses Re: Thread safe connection-name mapping in ECPG. Is it  (Lee Kindness <lkindness@csl.co.uk>)
List pgsql-hackers
On Friday 27 February 2004 20:54, Michael Meskes wrote:
> On Fri, Feb 27, 2004 at 04:22:33PM +0530, Shridhar Daithankar wrote:
> > How about, allowing 'connection *'? If somebody puts a 'connection *'
> > there it is used. If it is a string a name search is performed. Best of
> > both worlds.
>
> How shall anyone put a pointer to a connection struct inside the SQL
> statement?
>
> It would help me a lot if you'd be able to give some examples.

EXEC SQL BEGIN DECLARE SECTION;connect *connectionPtr;
EXEC SQL END DECLARE SECTION;

EXEC SQL CONNECT TO db AS connectionPtr;
EXEC SQL AT connectionPtr SELECT 1;

After all, it is matter of parsing some code and emitting equivalent C code, 
isn't it?
Shridhar


pgsql-hackers by date:

Previous
From: Michael Brusser
Date:
Subject: Re: Question on pg_dump
Next
From: "scott.marlowe"
Date:
Subject: Re: Tablespaces