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

Lists: pgsql-hackers
From: "Zeugswetter Andreas SB SD" <ZeugswetterA(at)spardat(dot)at>
To: "Shridhar Daithankar" <shridhar(at)frodo(dot)hserus(dot)net>, "Michael Meskes" <meskes(at)postgresql(dot)org>
Cc: "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Thread safe connection-name mapping in ECPG. Is it
Date: 2004-02-27 10:15:27
Message-ID: 46C15C39FEB2C44BA555E356FBCD6FA40184CFF1@m0114.s-mxs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


> I am asking for CONNECTION being a variable of data type 'connection *' rather
> than 'const char *'. That would avoid name lookups.
>
> Is that out of spec?

Yes, but the preprocessor could still add an optimization ala 'connection *' for
the hardcoded cases (exec sql set connection 'myconn1'; exec sql at 'myconn1' ...).
It needs to maintain the string list for the non hardcoded cases though.

Andreas


From: Shridhar Daithankar <shridhar(at)frodo(dot)hserus(dot)net>
To: Zeugswetter Andreas SB SD <ZeugswetterA(at)spardat(dot)at>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Thread safe connection-name mapping in ECPG. Is it
Date: 2004-02-27 10:52:33
Message-ID: 403F2171.1080408@frodo.hserus.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Zeugswetter Andreas SB SD wrote:

>>I am asking for CONNECTION being a variable of data type 'connection *' rather
>>than 'const char *'. That would avoid name lookups.
>>
>>Is that out of spec?
> Yes, but the preprocessor could still add an optimization ala 'connection *' for
> the hardcoded cases (exec sql set connection 'myconn1'; exec sql at 'myconn1' ...).
> It needs to maintain the string list for the non hardcoded cases though.

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.

Can that be an acceptable compromise?

Shridhar


From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Shridhar Daithankar <shridhar(at)frodo(dot)hserus(dot)net>
Cc: 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-02-27 15:24:31
Message-ID: 20040227152431.GB27113@trantor.fam-meskes.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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.

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!


From: Shridhar Daithankar <shridhar(at)frodo(dot)hserus(dot)net>
To: Michael Meskes <meskes(at)postgresql(dot)org>
Cc: 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-02-27 15:29:10
Message-ID: 200402272059.10660.shridhar@frodo.hserus.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: 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


From: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>
To: shridhar(at)frodo(dot)hserus(dot)net
Cc: Michael Meskes <meskes(at)postgresql(dot)org>, Zeugswetter Andreas SB SD <ZeugswetterA(at)spardat(dot)at>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Lee Kindness <lkindness(at)csl(dot)co(dot)uk>
Subject: Re: Thread safe connection-name mapping in ECPG. Is it
Date: 2004-02-27 16:54:39
Message-ID: 16447.30287.543731.479608@kelvin.csl.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Sort of related, I was thinking about adding some more thread-related
code such that if a connection wasn't explicitely specified then the
last connection SET or CONNECTed to for the current thread is used,
rather than just the "last connection".

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.

L.

Shridhar Daithankar writes:
> 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


From: Shridhar Daithankar <shridhar_daithankar(at)persistent(dot)co(dot)in>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Thread safe connection-name mapping in ECPG. Is it
Date: 2004-02-28 08:40:27
Message-ID: 200402281410.27307.shridhar_daithankar@persistent.co.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Friday 27 February 2004 22:24, Lee Kindness wrote:
> Sort of related, I was thinking about adding some more thread-related
> code such that if a connection wasn't explicitely specified then the
> last connection SET or CONNECTed to for the current thread is used,
> rather than just the "last connection".
>
> 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.

Consider another scenario. In a C++ class you want to contain a database
connection. The class needs to make n resources thread safe, including
database connection. Now each instance of class would be referring to
differnet database connection with same code.

Doing same with char strings, is just clean enough IMHO..

Shridhar


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>
Cc: 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-03 13:47:50
Message-ID: 200403031347.i23DloT17618@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Should I add this to the TODO list?

---------------------------------------------------------------------------

Lee Kindness wrote:
> Sort of related, I was thinking about adding some more thread-related
> code such that if a connection wasn't explicitely specified then the
> last connection SET or CONNECTed to for the current thread is used,
> rather than just the "last connection".
>
> 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.
>
> L.
>
> Shridhar Daithankar writes:
> > 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Shridhar Daithankar <shridhar(at)frodo(dot)hserus(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Thread safe connection-name mapping in ECPG. Is it
Date: 2004-03-03 14:10:40
Message-ID: 4045E760.6080605@frodo.hserus.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Oh.. By all means..Please do..

The reason I posted it because I didn't wanted to work on it if core is not
going to accept it on account of non-compliance with spec.

Is this fine?
* Allow a 'connection *' pointer to be specified instead of a string to denote
a connection.

I plan to work on it whenever possible. What I would like to do is eliminate the
locks around name->connection mapping as we would be directly using the
connection instead of a name.

I think we can also add the SQL-CA to connection structure so that each
connection gets it's own SQL-CA. That way ECPG is as thread-safe as the calling
application gets.

And on the plus side we don't have to worry about platform specific threading
models either.

Thoughts?

Shridhar

Bruce Momjian wrote:

> Should I add this to the TODO list?
>
> ---------------------------------------------------------------------------
>
> Lee Kindness wrote:
>
>>Sort of related, I was thinking about adding some more thread-related
>>code such that if a connection wasn't explicitely specified then the
>>last connection SET or CONNECTed to for the current thread is used,
>>rather than just the "last connection".
>>
>>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.
>>
>>L.
>>
>>Shridhar Daithankar writes:
>> > 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
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 4: Don't 'kill -9' the postmaster
>>
>
>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Shridhar Daithankar <shridhar(at)frodo(dot)hserus(dot)net>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Thread safe connection-name mapping in ECPG. Is it
Date: 2004-03-03 15:12:18
Message-ID: 12876.1078326738@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Shridhar Daithankar <shridhar(at)frodo(dot)hserus(dot)net> writes:
> The reason I posted it because I didn't wanted to work on it if core is not
> going to accept it on account of non-compliance with spec.

When it comes to ecpg, Michael Meskes is the man you have to convince,
not any of the core committee.

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Shridhar Daithankar <shridhar(at)frodo(dot)hserus(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Thread safe connection-name mapping in ECPG. Is it
Date: 2004-03-03 17:34:20
Message-ID: 200403031734.i23HYKM29474@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Shridhar Daithankar <shridhar(at)frodo(dot)hserus(dot)net> writes:
> > The reason I posted it because I didn't wanted to work on it if core is not
> > going to accept it on account of non-compliance with spec.
>
> When it comes to ecpg, Michael Meskes is the man you have to convince,
> not any of the core committee.

Michael doesn't own ecpg any more than the core owns the backend code.
I would get an opinion from Michael and see what others think of the
idea. You can always ask for a vote too.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: "Lee Kindness" <lkindness(at)csl(dot)co(dot)uk>
To: "Shridhar Daithankar" <shridhar(at)frodo(dot)hserus(dot)net>, "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Thread safe connection-name mapping in ECPG. Is it
Date: 2004-03-03 23:23:51
Message-ID: 006a01c40176$9892e930$2c8fe150@coulter
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Shridhar, want to discuss this off list a bit to work through the various
options and then revent back to the list with a suitable to-do (for
discussion)?

L.

----- Original Message -----
From: "Shridhar Daithankar" <shridhar(at)frodo(dot)hserus(dot)net>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Sent: Wednesday, March 03, 2004 2:10 PM
Subject: Re: Thread safe connection-name mapping in ECPG. Is it

> Oh.. By all means..Please do..
>
> The reason I posted it because I didn't wanted to work on it if core is
not
> going to accept it on account of non-compliance with spec.
>
> Is this fine?
> * Allow a 'connection *' pointer to be specified instead of a string to
denote
> a connection.
>
> I plan to work on it whenever possible. What I would like to do is
eliminate the
> locks around name->connection mapping as we would be directly using the
> connection instead of a name.
>
> I think we can also add the SQL-CA to connection structure so that each
> connection gets it's own SQL-CA. That way ECPG is as thread-safe as the
calling
> application gets.
>
> And on the plus side we don't have to worry about platform specific
threading
> models either.
>
> Thoughts?
>
> Shridhar
>
> Bruce Momjian wrote:
>
> > Should I add this to the TODO list?
> >
>
> --------------------------------------------------------------------------
-
> >
> > Lee Kindness wrote:
> >
> >>Sort of related, I was thinking about adding some more thread-related
> >>code such that if a connection wasn't explicitely specified then the
> >>last connection SET or CONNECTed to for the current thread is used,
> >>rather than just the "last connection".
> >>
> >>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.
> >>
> >>L.
> >>
> >>Shridhar Daithankar writes:
> >> > 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
> >>
> >>---------------------------(end of broadcast)---------------------------
> >>TIP 4: Don't 'kill -9' the postmaster
> >>
> >
> >
>
>


From: Shridhar Daithankar <shridhar(at)frodo(dot)hserus(dot)net>
To: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Thread safe connection-name mapping in ECPG. Is it
Date: 2004-03-04 06:59:00
Message-ID: 4046D3B4.9010008@frodo.hserus.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Lee Kindness wrote:

> Shridhar, want to discuss this off list a bit to work through the various
> options and then revent back to the list with a suitable to-do (for
> discussion)?

I don't mind. Just for summary, I am listing the discussion/proposal so far on
this issue..

- Dispose names of connectiong and replace them with a pointer.
- Make SQL CA a member of connection structure rather than a thread local variable.
- Update man pages and documentation
- Update examples.

Drop me a mail offline to take this further.

Shridhar


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
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!


From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Shridhar Daithankar <shridhar(at)frodo(dot)hserus(dot)net>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Thread safe connection-name mapping in ECPG. Is it
Date: 2004-03-07 14:58:47
Message-ID: 20040307145847.GB22118@1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Mar 03, 2004 at 07:40:40PM +0530, Shridhar Daithankar wrote:
> Is this fine?
> * Allow a 'connection *' pointer to be specified instead of a string to
> denote a connection.
> ...

I personally have no problem with this as long as it does not break
compatibility to the code we allow now.

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!


From: "Lee Kindness" <lkindness(at)csl(dot)co(dot)uk>
To: "Michael Meskes" <meskes(at)postgresql(dot)org>, "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: <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 19:53:47
Message-ID: 00cb01c4047d$e9bfa2d0$2b08a8c0@coulter
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


From: "Michael Meskes" <meskes(at)postgresql(dot)org>
> Why? What doesn't work? AFAIRC the AT statement does indeed allow a
> variable as connection_target.

Yeah, I was wrong there. I updated the thread test program in ecpg/test to
make use of this functionality - see patch in pgsql-patches yesterday.

L.


From: Shridhar Daithankar <shridhar(at)frodo(dot)hserus(dot)net>
To: Michael Meskes <meskes(at)postgresql(dot)org>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Thread safe connection-name mapping in ECPG. Is it
Date: 2004-03-09 06:57:29
Message-ID: 200403091227.29252.shridhar@frodo.hserus.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sunday 07 March 2004 20:28, Michael Meskes wrote:
> On Wed, Mar 03, 2004 at 07:40:40PM +0530, Shridhar Daithankar wrote:
> > Is this fine?
> > * Allow a 'connection *' pointer to be specified instead of a string to
> > denote a connection.
> > ...
>
> I personally have no problem with this as long as it does not break
> compatibility to the code we allow now.

I searched thr. SQL92 standard over weekend(sunday and monday.. had a working
saturday..:-)) And need to correct some of the assumptions I stated
previously.

In ECPG we can not dispose connection names as strings because standard
expects it. Hence if we need to provide a connection pointer to denote a
connection, that would be a postgresql only extension and such should be
documented and warned for potential portability problem.

With responses so far, I believe it is OK for me to go ahead and actually try
some coding now..:-)

Will keep things posted.

Shridhar