Re: Is PREPARE of ecpglib thread safe?

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: matsumura(dot)ryo(at)jp(dot)fujitsu(dot)com
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Is PREPARE of ecpglib thread safe?
Date: 2019-03-15 06:37:30
Message-ID: 20190315.153730.145802138.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Oops.

At Fri, 15 Mar 2019 15:33:50 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote in <20190315(dot)153350(dot)226491548(dot)horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Haribabu Kommi 2019-03-15 07:23:48 Re: pg_basebackup ignores the existing data directory permissions
Previous Message David G. Johnston 2019-03-15 06:33:52 Re: Facing issue in using special characters