From: | amul sul <sulamul(at)gmail(dot)com> |
---|---|
To: | Andrew Borodin <amborodin(at)acm(dot)org> |
Cc: | Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: background sessions |
Date: | 2016-12-15 07:31:32 |
Message-ID: | CAAJ_b97fqGXAFkovxc+750tMziRoFaqGFL4weU7Hr01EgCNJJw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Dec 15, 2016 at 12:24 PM, Andrew Borodin <borodin(at)octonica(dot)com> wrote:
> 2016-12-15 0:30 GMT+05:00 Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>:
>>>>> TryBeginSession()?
>>>>
>>>> What exactly would that do?
>>> Return status (success\failure) and session object, if a function succeeded.
>>>
>>> If there is max_connections exceeded, then (false,null).
>>>
>>> I'm not sure whether this idiom is common for Python.
>>
>> You can catch PostgreSQL exceptions in PL/Python, so this can be handled
>> in user code.
>>
>> Some better connection management or pooling can probably be built on
>> top of the primitives later, I'd say.
>
> Agree, doing this in Python is the better option.
>
> And one more thing... Can we have BackgroundSessionExecute() splitted
> into two parts: start query and wait for results?
> It would allow pg_background to reuse bgsession's code.
>
+1
Regards,
Amul
From | Date | Subject | |
---|---|---|---|
Next Message | Craig Ringer | 2016-12-15 08:02:04 | bigint vs txid user confusion |
Previous Message | Andrew Borodin | 2016-12-15 06:54:44 | Re: background sessions |