Re: feature request: consume asynchronous notification via a function

2017-11-21 Thread Merlin Moncure
On Tue, Nov 21, 2017 at 2:16 PM, Merlin Moncure wrote: > On Tue, Nov 21, 2017 at 12:20 PM, Tom Lane wrote: >> Robert Haas writes: >>> On Tue, Nov 21, 2017 at 11:32 AM, Merlin Moncure wrote: I am very much looking at the new stored procedure functionality and imaging a loop like this:

Re: feature request: consume asynchronous notification via a function

2017-11-21 Thread Merlin Moncure
On Tue, Nov 21, 2017 at 12:20 PM, Tom Lane wrote: > Robert Haas writes: >> On Tue, Nov 21, 2017 at 11:32 AM, Merlin Moncure wrote: >>> I am very much looking at the new stored procedure functionality and >>> imaging a loop like this: >>> >>> LOOP >>> FOR r IN SELECT * FROM pg_get_notifications

Re: feature request: consume asynchronous notification via a function

2017-11-21 Thread Tom Lane
Robert Haas writes: > On Tue, Nov 21, 2017 at 11:32 AM, Merlin Moncure wrote: >> I am very much looking at the new stored procedure functionality and >> imaging a loop like this: >> >> LOOP >> FOR r IN SELECT * FROM pg_get_notifications(30) >> LOOP >> PERFORM do_stuff(r); >> END LOOP;

Re: feature request: consume asynchronous notification via a function

2017-11-21 Thread Robert Haas
On Tue, Nov 21, 2017 at 11:32 AM, Merlin Moncure wrote: >> I think that wouldn't work very well, because I think we must have a >> snapshot open in order to run pg_get_notifications(), and that means >> we're holding back the system-wide xmin. > > I am very much looking at the new stored procedure

Re: feature request: consume asynchronous notification via a function

2017-11-21 Thread Merlin Moncure
On Tue, Nov 21, 2017 at 7:59 AM, Robert Haas wrote: > On Fri, Nov 17, 2017 at 9:49 AM, Merlin Moncure wrote: >> Currently the only way that I know of to consume async notifications >> via SQL (as opposed to a client application) is via dblink_get_notify. >> This method isn't very good; it require

Re: feature request: consume asynchronous notification via a function

2017-11-21 Thread Robert Haas
On Fri, Nov 17, 2017 at 9:49 AM, Merlin Moncure wrote: > Currently the only way that I know of to consume async notifications > via SQL (as opposed to a client application) is via dblink_get_notify. > This method isn't very good; it requires some extra support coding, > eats a connection and a bac

feature request: consume asynchronous notification via a function

2017-11-17 Thread Merlin Moncure
Hackers, Currently the only way that I know of to consume async notifications via SQL (as opposed to a client application) is via dblink_get_notify. This method isn't very good; it requires some extra support coding, eats a connection and a backend, and doesn't have any timeout facilities. The la