Re: Optimization for updating foreign tables in Postgres FDW

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, Noah Misch <noah(at)leadboat(dot)com>, Thom Brown <thom(at)linux(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Shigeru Hanada <shigeru(dot)hanada(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Optimization for updating foreign tables in Postgres FDW
Date: 2016-04-13 12:50:24
Message-ID: CAB7nPqRG=9rVmVtKnv+UQ2Pptj0PLxcByGZRaO_31qs7qa1hfg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 13, 2016 at 9:46 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Tue, Apr 12, 2016 at 10:24 PM, Etsuro Fujita
> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>>> How about we encapsulate the while (PQisBusy(...)) loop into a new
>>> function pgfdw_get_result(), which can be called after first calling
>>> PQsendQueryParams()? So then this code will say dmstate->result =
>>> pgfdw_get_result(dmstate->conn). And we can do something similar for
>>> the other call to PQexecParams() in create_cursor(). Then let's also
>>> add something like pgfdw_exec_query() which calls PQsendQuery() and
>>> then pgfdw_get_result, and use that to replace all of the existing
>>> calls to PQexec().
>>>
>>> Then all the SQL postgres_fdw executes would be interruptible, not
>>> just the new stuff.
>>
>> Seems like a good idea. Will do.
>
> When will you do this? We are on a bit of a time budget here.

Fujita-san, I can code that tomorrow or in two days if need be. That
should not be an issue from here.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-04-13 13:33:14 Re: Why doesn't src/backend/port/win32/socket.c implement bind()?
Previous Message Michael Paquier 2016-04-13 12:49:13 Re: SET ROLE and reserved roles