Re: Is PREPARE of ecpglib thread safe? - Mailing list pgsql-hackers

From Kyotaro HORIGUCHI
Subject Re: Is PREPARE of ecpglib thread safe?
Date
Msg-id 20190315.153730.145802138.horiguchi.kyotaro@lab.ntt.co.jp
Whole thread Raw
In response to Re: Is PREPARE of ecpglib thread safe?  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
List pgsql-hackers
Oops.

At Fri, 15 Mar 2019 15:33:50 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> wrote in
<20190315.153350.226491548.horiguchi.kyotaro@lab.ntt.co.jp>
> >   // If ecpglib didn't reject the above, ecpglib cannot judge
> >   // which connection the followings should be executed on.
> >   exec sql prepare st1 from "select 1";
> >   exec sql execute st1;
> 
> I'm not sure about ECPG, but according to the documentation, the
> following statements should work correctly.
> 
>    SQL SET CONNECTION con1;

Of course this is missing prefixing "EXEC".

>    EXEC SQL PREPARE st1 FROM "select 1";
>    EXEC SQL EXECUTE st1;
> 
> should succeed and executed on con1.
> 
> > Kuroda-san, is it right?
> > If it's right, I will fix it with using pthread_lock.
> 
> Mmm. Are you saying that prepared statements on ECPG should have
> names in global namespace and EXECUTE should implicitly choose
> the underlying connection automatically from the name of a
> prepared statement? I don't think it is the right direction.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



pgsql-hackers by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: Is PREPARE of ecpglib thread safe?
Next
From: Haribabu Kommi
Date:
Subject: Re: pg_basebackup ignores the existing data directory permissions