Re: [v9.3] writable foreign tables
От | Albe Laurenz |
---|---|
Тема | Re: [v9.3] writable foreign tables |
Дата | |
Msg-id | D960CB61B694CF459DCFB4B0128514C208B882AF@exadv11.host.magwien.gv.at обсуждение исходный текст |
Ответ на | Re: [v9.3] writable foreign tables (Kohei KaiGai <kaigai@kaigai.gr.jp>) |
Ответы |
Re: [v9.3] writable foreign tables
|
Список | pgsql-hackers |
Kohei KaiGai wrote: > Probably, it is helpful to provide a helper function that fetches an attribute- > number of pseudo "rowid" column from the supplied targetlist. > If we have GetPseudoRowidColumn() at foreign/foreign.c, the avove > routine can be rewritten as: > > static AttrNumber > fileGetForeignRelWidth(PlannerInfo *root, > RelOptInfo *baserel, > Relation foreignrel, > bool inhparent, List *targetList) > { > FileFdwPlanState *fdw_private; > AttrNumber nattrs = RelationGetNumberOfAttributes(foreignrel); > AttrNumber anum_rowid; > > fdw_private = palloc0(sizeof(FileFdwPlanState)); > anum_rowid = GetPseudoRowidColumn(..., targetList); > if (anum_rowid > 0) > { > Assert(anum_rowid > nattrs); > fdw_private->anum_rowid > = makeDefElem("anum_rowid", (Node *)makeInteger(anum_rowid)); > nattrs = anum_rowid; > } > baserel->fdw_private = fdw_private; > > return nattrs; > } > > In case when FDW drive wants to push-down other target entry into foreign- > side, thus, it needs multiple pseudo-columns, it is decision of the extension. > In addition, it does not take API change in the future, if some more additional > pseudo-column is required by some other new features. > > How about your opinion? I think that this is better than what I suggested. Yours, Laurenz Albe
В списке pgsql-hackers по дате отправления: