Skip Menu |

This queue is for tickets about the DBD-Pg CPAN distribution.

Report information
The Basics
Id: 116172
Status: resolved
Priority: 0/
Queue: DBD-Pg

People
Owner: Nobody in particular
Requestors: ZDM [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: 3.7.0



Subject: Is it possible to know is sth was prepared with pg_async or not?
Hi. Is it possible to implement sth attribute, that will indicate, that sth was prepared with pg_async attribute?
Show quoted text
> Is it possible to implement sth attribute, that will indicate, that > sth was prepared with pg_async attribute?
Yes, that should be simple enough. Will throw it on the TODO list, and hopefully will be a part of the next release.
Subject: Re: [rt.cpan.org #116172] Is it possible to know is sth was prepared with pg_async or not?
Date: Tue, 19 Jul 2016 08:20:58 +0300
To: bug-DBD-Pg [...] rt.cpan.org
From: "dzagashev [...] gmail.com" <dzagashev [...] gmail.com>
Thank you. On 19.07.2016 05:27, Greg Sabino Mullane via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=116172 > >
>> Is it possible to implement sth attribute, that will indicate, that >> sth was prepared with pg_async attribute?
> > Yes, that should be simple enough. Will throw it on the TODO list, and hopefully will be a part of the next release. >
Currently I need to prepare same query twice, for async and blocking execution separately. And prepare call is always blocking. Is it possible to create additional methods: prepare_async($sql, $async_type, ...) - that will call PQsendPrepare, execute_async($sql or $sth, $async_type, @bind) - will call PQsendQueryPrepared or PQsendQuery; Where $async_type is PG_OLDQUERY_CANCEL or PG_OLDQUERY_WAIT; And do not use pg_async attribute at all?
On Tue Jul 19 02:13:20 2016, ZDM wrote: Show quoted text
> Currently I need to prepare same query twice, for async and blocking > execution separately. > > And prepare call is always blocking. > > Is it possible to create additional methods: > > prepare_async($sql, $async_type, ...) - that will call PQsendPrepare, > > execute_async($sql or $sth, $async_type, @bind) - will call > PQsendQueryPrepared or PQsendQuery; > > Where $async_type is PG_OLDQUERY_CANCEL or PG_OLDQUERY_WAIT; > > And do not use pg_async attribute at all?
Very unlikely - that would stomp all over the DBI namespace, for one thing. Best we could do is pg_prepare_async, but that seems overkill when that's what attributes are for. :)
Subject: Re: [rt.cpan.org #116172] Is it possible to know is sth was prepared with pg_async or not?
Date: Fri, 31 Mar 2017 18:52:02 +0300
To: bug-DBD-Pg [...] rt.cpan.org
From: "dzagashev [...] gmail.com" <dzagashev [...] gmail.com>
DBI is good, but has a lack of modern features. Async queries ia a "must have" feature today. I created a complex non-blocking wrapper to check is async query ready. It will be perfect, if DBI methods can get callback as parameter and call it, when will get results. On 31.03.2017 18:01, Greg Sabino Mullane via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=116172 > > > On Tue Jul 19 02:13:20 2016, ZDM wrote:
>> Currently I need to prepare same query twice, for async and blocking >> execution separately. >> >> And prepare call is always blocking. >> >> Is it possible to create additional methods: >> >> prepare_async($sql, $async_type, ...) - that will call PQsendPrepare, >> >> execute_async($sql or $sth, $async_type, @bind) - will call >> PQsendQueryPrepared or PQsendQuery; >> >> Where $async_type is PG_OLDQUERY_CANCEL or PG_OLDQUERY_WAIT; >> >> And do not use pg_async attribute at all?
> > Very unlikely - that would stomp all over the DBI namespace, for one thing. Best we could do is pg_prepare_async, but that seems overkill when that's what attributes are for. :) >
Added $sth->{pg_async_status} as of 44bc762ae526d7d644942dac9de167b937b16d0d. Note that we cannot know if async or not until *after* the execute.