1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

Clean up handling of inherited-table update queries, per bug report

from Sebastian Böck.  The fix involves being more consistent about
when rangetable entries are copied or modified.  Someday we really
need to fix this stuff to not scribble on its input data structures
in the first place...
This commit is contained in:
Tom Lane
2004-10-02 22:39:49 +00:00
parent 19241421f2
commit 47aa95e951
5 changed files with 78 additions and 55 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.121 2004/08/29 05:06:43 momjian Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.122 2004/10/02 22:39:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -124,8 +124,7 @@ set_base_rel_pathlists(Query *root)
/* RangeFunction --- generate a separate plan for it */
set_function_pathlist(root, rel, rte);
}
else if ((inheritlist = expand_inherited_rtentry(root, rti, true))
!= NIL)
else if ((inheritlist = expand_inherited_rtentry(root, rti)) != NIL)
{
/* Relation is root of an inheritance tree, process specially */
set_inherited_rel_pathlist(root, rel, rti, rte, inheritlist);
@ -223,13 +222,6 @@ set_inherited_rel_pathlist(Query *root, RelOptInfo *rel,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("SELECT FOR UPDATE is not supported for inheritance queries")));
/*
* The executor will check the parent table's access permissions when
* it examines the parent's inheritlist entry. There's no need to
* check twice, so turn off access check bits in the original RTE.
*/
rte->requiredPerms = 0;
/*
* Initialize to compute size estimates for whole inheritance tree
*/