Re: background sessions

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: amul sul <sulamul(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Andrew Borodin <amborodin(at)acm(dot)org>
Subject: Re: background sessions
Date: 2017-01-03 14:39:38
Message-ID: bb7e3dc1-1cf9-a538-c883-0fe60ad14f68@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/3/17 1:26 AM, amul sul wrote:
> One more requirement for pg_background is session, command_qh,
> response_qh and worker_handle should be last longer than current
> memory context, for that we might need to allocate these in
> TopMemoryContext. Please find attach patch does the same change in
> BackgroundSessionStart().

I had pondered this issue extensively. The standard coding convention
in postgres is that the caller sets the memory context. See the dblink
and plpython patches that make this happen in their own way.

I agree it would make sense that you either pass in a memory context or
always use TopMemoryContext. I'm open to these ideas, but they did not
seem to match any existing usage.

--
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 Fabien COELHO 2017-01-03 14:40:48 Re: proposal: session server side variables
Previous Message Peter Eisentraut 2017-01-03 14:34:38 Re: [PATCH] Reload SSL certificates on SIGHUP