Re: cursors with prepared statements

2018-12-01 Thread Dmitry Dolgov
> On Thu, Nov 22, 2018 at 11:11 AM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > > On Wed, Jul 18, 2018 at 10:27 AM Heikki Linnakangas wrote: > > > > On 16/07/18 15:56, Peter Eisentraut wrote: > > > On 11.07.18 19:07, Heikki Linnakangas wrote: > > >> It's confusing, and risks conflicting with f

Re: cursors with prepared statements

2018-11-22 Thread Dmitry Dolgov
> On Wed, Jul 18, 2018 at 10:27 AM Heikki Linnakangas wrote: > > On 16/07/18 15:56, Peter Eisentraut wrote: > > On 11.07.18 19:07, Heikki Linnakangas wrote: > >> It's confusing, and risks conflicting with future additions to > >> the standard. ECPG supports the actual standard syntax, with OPEN, >

Re: cursors with prepared statements

2018-07-18 Thread Heikki Linnakangas
On 16/07/18 15:56, Peter Eisentraut wrote: On 11.07.18 19:07, Heikki Linnakangas wrote: It's confusing, and risks conflicting with future additions to the standard. ECPG supports the actual standard syntax, with OPEN, right? So this wouldn't be consistent with ECPG, either. It would be consist

Re: cursors with prepared statements

2018-07-16 Thread Robert Haas
On Mon, Jul 16, 2018 at 8:56 AM, Peter Eisentraut wrote: >> The attached patch seems to do the trick, of allowing EXECUTE + USING. >> I'm not sure this is worth the trouble, though, since EXECUTE as a plain >> SQL command is a PostgreSQL-extension anyway. > > I think it's a PostgreSQL extension th

Re: cursors with prepared statements

2018-07-16 Thread Peter Eisentraut
On 11.07.18 19:07, Heikki Linnakangas wrote: >> One point worth pondering is how to pass the parameters of the prepared >> statements. The actual SQL standard syntax would be >> >> DECLARE cursor_name CURSOR FOR prepared_statement_name; >> OPEN cursor_name USING param, param; >> >> But s

Re: cursors with prepared statements

2018-07-11 Thread Heikki Linnakangas
On 07/06/18 22:42, Peter Eisentraut wrote: I have developed a patch that allows declaring cursors over prepared statements: DECLARE cursor_name CURSOR FOR prepared_statement_name [ USING param, param, ... ] This is an SQL standard feature. ECPG already

Re: cursors with prepared statements

2018-06-12 Thread Amit Kapila
On Mon, Jun 11, 2018 at 9:56 PM, Peter Eisentraut wrote: > On 6/11/18 09:57, Amit Kapila wrote: >> Sounds like a reasonable approach. Have you not considered using a >> special OPEN syntax because there are some other forms of problems >> with it? > > There is no OPEN command in direct SQL. Do y

Re: cursors with prepared statements

2018-06-11 Thread Peter Eisentraut
On 6/11/18 09:57, Amit Kapila wrote: > Sounds like a reasonable approach. Have you not considered using a > special OPEN syntax because there are some other forms of problems > with it? There is no OPEN command in direct SQL. Do you mean whether I have considered introducing an OPEN command? Ye

Re: cursors with prepared statements

2018-06-11 Thread Amit Kapila
On Fri, Jun 8, 2018 at 1:12 AM, Peter Eisentraut wrote: > I have developed a patch that allows declaring cursors over prepared > statements: > > DECLARE cursor_name CURSOR FOR prepared_statement_name >[ USING param, param, ... ] > > This is an SQL standard f