Re: Update does not move row across foreign partitions in v11

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Update does not move row across foreign partitions in v11
Дата
Msg-id CAKJS1f81JuXMv+Ay8Nbfisgi+76Y2f9PO-jVw_J5-E_KpBN_Mg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Update does not move row across foreign partitions in v11  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Ответы Re: Update does not move row across foreign partitions in v11
Список pgsql-hackers
On Wed, 6 Mar 2019 at 17:20, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> wrote:
>
> On 2019/03/06 12:47, David Rowley wrote:
> > It seems a bit light on detail to me. If I was a user I'd want to know
> > what exactly the FDW needed to support this. Does it need a special
> > partition move function?  Looking at ExecFindPartition(), this check
> > seems to be done in CheckValidResultRel() and is basically:
> >
> > case RELKIND_FOREIGN_TABLE:
> > /* Okay only if the FDW supports it */
> > fdwroutine = resultRelInfo->ri_FdwRoutine;
> > switch (operation)
> > {
> > case CMD_INSERT:
> > if (fdwroutine->ExecForeignInsert == NULL)
> > ereport(ERROR,
> > (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
> > errmsg("cannot insert into foreign table \"%s\"",
> > RelationGetRelationName(resultRel))));
> >
> > Alternatively, we could just remove the mention about "if the FDW
> > supports it", since it's probably unlikely for an FDW not to support
> > INSERT.
>
> AFAIK, there's no special support in FDWs for "tuple moving" as such.  The
> "if the FDW supports it" refers to the FDW's ability to handle tuple
> routing.  Note that moving/re-routing involves calling
> ExecPrepareTupleRouting followed by ExecInsert on the new tupls after the
> old tuple is deleted.  If an FDW doesn't support tuple routing, then a
> tuple cannot be moved into it.  That's what that text is talking about.
>
> Maybe, we should reword it as "if the FDW supports tuple routing", so that
> a reader doesn't go looking around for "tuple moving support" in FDWs.

I think you missed my point.  If there's no special support for "tuple
moving", as you say, then what help is it to tell the user "if the FDW
supports tuple routing"?   The answer is, it's not any help. How would
the user check such a fact?

As far as I can tell, this is just the requirements as defined in
CheckValidResultRel() for CMD_INSERT. Fragments of which I pasted
above.

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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: New vacuum option to do only freezing
Следующее
От: David Rowley
Дата:
Сообщение: Re: Inheriting table AMs for partitioned tables