Re: A problem presentaion about ECPG, DECLARE STATEMENT

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Michael Meskes <meskes(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "kuroda(dot)hayato(at)fujitsu(dot)com" <kuroda(dot)hayato(at)fujitsu(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: A problem presentaion about ECPG, DECLARE STATEMENT
Date: 2019-09-16 11:12:17
Message-ID: 0eb53d98-d771-9cac-44ce-c1eb18ef0767@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-09-11 18:04, Michael Meskes wrote:
>>>> Is it acceptable for PG12?
>>> In general absolutely.
>>
>> It seems far too late to be considering any major rewrite for v12;
>> even assuming that there was consensus on the rewrite being an
>> improvement, which I bet there won't be.
>
> Oops, I read 13. Yes, it's obviously way too late for 12. Sorry for the
> noise.
>
> In this case I'd like to details about what is wrong with the
> implementation.

I tried finding some information about where the idea for this statement
came from but couldn't find any. The documentation references Oracle
and DB2, and while they indeed do have this statement, it doesn't seem
to be used for the same purpose. The only purpose in ECPG appears to be
to associate a statement with a connection, but for example the DB2
implementation doesn't even have the AT clause, so I don't see how that
could be the same.

Moreover, I've been wondering about the behavior detail given in the
table at
<https://www.postgresql.org/docs/devel/ecpg-sql-declare-statement.html>.
In scenario 3, the declare statement says con1 but the subsequent
dynamic statement says con2, and as a result of that, con1 is used.
This is not intuitive, I'd say, but given that there is no indication of
where this statement came from or whose idea it follows, it's unclear
how to evaluate that.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2019-09-16 11:14:21 ecpglib major version changed
Previous Message Martijn van Oosterhout 2019-09-16 11:07:49 Re: [PATCH] Improve performance of NOTIFY over many databases (v2)