Re: background sessions

From: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Craig Ringer <craig(dot)ringer(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Andrey Borodin <amborodin(at)acm(dot)org>
Subject: Re: background sessions
Date: 2016-12-13 03:09:22
Message-ID: d0040cb4-3a5b-51a5-6037-156aa57aefa1@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/12/16 16:29, Robert Haas wrote:
> On Mon, Dec 12, 2016 at 10:02 AM, Craig Ringer
> <craig(dot)ringer(at)2ndquadrant(dot)com> wrote:
>> On 12 Dec. 2016 21:55, "Robert Haas" <robertmhaas(at)gmail(dot)com> wrote:
>> On Sun, Dec 11, 2016 at 5:38 AM, Andrew Borodin <borodin(at)octonica(dot)com>
>> wrote:
>>> 1. As far as I can see, we connot use COPY FROM STDIN in bg session?
>>> Since one of purposes is to orchestrate transactions, may be that
>>> would be valuable.
>>
>> A background worker has no client connection, so what would COPY FROM STDIN
>> do?
>>
>> It doesn't make sense. But a bgworker may well want to supply input to COPY.
>> A COPY FROM CALLBACK of COPY FROM FILEDESC or whatever.
>
> That's kinda weird, though. I mean, you don't need to go through all
> of the COPY code just to call heap_multi_insert() or whatever, do you?
> You can hand-roll whatever you need there.
>

You do if source of your data is already in COPY (or csv) format. I do
have similar usecase in logical replication followup patch that I plan
to submit to Jan CF, so maybe that will be interesting for this as well.

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2016-12-13 03:16:06 Re: Quorum commit for multiple synchronous replication.
Previous Message CK Tan 2016-12-13 02:29:42 Re: WIP: Faster Expression Processing and Tuple Deforming (including JIT)