pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Ensure tableoid reads correctly in EvalPlanQual-manufactured tup 5+ messages / 1 participants [nested] [flat]
* pgsql: Ensure tableoid reads correctly in EvalPlanQual-manufactured tup @ 2015-03-12 17:39 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2015-03-12 17:39 UTC (permalink / raw) To: pgsql-committers Ensure tableoid reads correctly in EvalPlanQual-manufactured tuples. The ROW_MARK_COPY path in EvalPlanQualFetchRowMarks() was just setting tableoid to InvalidOid, I think on the assumption that the referenced RTE must be a subquery or other case without a meaningful OID. However, foreign tables also use this code path, and they do have meaningful table OIDs; so failure to set the tuple field can lead to user-visible misbehavior. Fix that by fetching the appropriate OID from the range table. There's still an issue about whether CTID can ever have a meaningful value in this case; at least with postgres_fdw foreign tables, it does. But that is a different problem that seems to require a significantly different patch --- it's debatable whether postgres_fdw really wants to use this code path at all. Simplified version of a patch by Etsuro Fujita, who also noted the problem to begin with. The issue can be demonstrated in all versions having FDWs, so back-patch to 9.1. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/443fd0540e298b621be6748dead1fb444556e0d0 Modified Files -------------- src/backend/executor/execMain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Ensure tableoid reads correctly in EvalPlanQual-manufactured tup @ 2015-03-12 17:39 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2015-03-12 17:39 UTC (permalink / raw) To: pgsql-committers Ensure tableoid reads correctly in EvalPlanQual-manufactured tuples. The ROW_MARK_COPY path in EvalPlanQualFetchRowMarks() was just setting tableoid to InvalidOid, I think on the assumption that the referenced RTE must be a subquery or other case without a meaningful OID. However, foreign tables also use this code path, and they do have meaningful table OIDs; so failure to set the tuple field can lead to user-visible misbehavior. Fix that by fetching the appropriate OID from the range table. There's still an issue about whether CTID can ever have a meaningful value in this case; at least with postgres_fdw foreign tables, it does. But that is a different problem that seems to require a significantly different patch --- it's debatable whether postgres_fdw really wants to use this code path at all. Simplified version of a patch by Etsuro Fujita, who also noted the problem to begin with. The issue can be demonstrated in all versions having FDWs, so back-patch to 9.1. Branch ------ REL9_4_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/32269be59efc740ca8c800b348d8ea8098d91ab2 Modified Files -------------- src/backend/executor/execMain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Ensure tableoid reads correctly in EvalPlanQual-manufactured tup @ 2015-03-12 17:39 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2015-03-12 17:39 UTC (permalink / raw) To: pgsql-committers Ensure tableoid reads correctly in EvalPlanQual-manufactured tuples. The ROW_MARK_COPY path in EvalPlanQualFetchRowMarks() was just setting tableoid to InvalidOid, I think on the assumption that the referenced RTE must be a subquery or other case without a meaningful OID. However, foreign tables also use this code path, and they do have meaningful table OIDs; so failure to set the tuple field can lead to user-visible misbehavior. Fix that by fetching the appropriate OID from the range table. There's still an issue about whether CTID can ever have a meaningful value in this case; at least with postgres_fdw foreign tables, it does. But that is a different problem that seems to require a significantly different patch --- it's debatable whether postgres_fdw really wants to use this code path at all. Simplified version of a patch by Etsuro Fujita, who also noted the problem to begin with. The issue can be demonstrated in all versions having FDWs, so back-patch to 9.1. Branch ------ REL9_3_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/5bdf3cf5ad3048e8376fff6ccf5dafd0e9d2e603 Modified Files -------------- src/backend/executor/execMain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Ensure tableoid reads correctly in EvalPlanQual-manufactured tup @ 2015-03-12 17:39 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2015-03-12 17:39 UTC (permalink / raw) To: pgsql-committers Ensure tableoid reads correctly in EvalPlanQual-manufactured tuples. The ROW_MARK_COPY path in EvalPlanQualFetchRowMarks() was just setting tableoid to InvalidOid, I think on the assumption that the referenced RTE must be a subquery or other case without a meaningful OID. However, foreign tables also use this code path, and they do have meaningful table OIDs; so failure to set the tuple field can lead to user-visible misbehavior. Fix that by fetching the appropriate OID from the range table. There's still an issue about whether CTID can ever have a meaningful value in this case; at least with postgres_fdw foreign tables, it does. But that is a different problem that seems to require a significantly different patch --- it's debatable whether postgres_fdw really wants to use this code path at all. Simplified version of a patch by Etsuro Fujita, who also noted the problem to begin with. The issue can be demonstrated in all versions having FDWs, so back-patch to 9.1. Branch ------ REL9_2_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/590fc5d96f8b880fd41c4992dab73ec47f90eca4 Modified Files -------------- src/backend/executor/execMain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Ensure tableoid reads correctly in EvalPlanQual-manufactured tup @ 2015-03-12 17:39 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2015-03-12 17:39 UTC (permalink / raw) To: pgsql-committers Ensure tableoid reads correctly in EvalPlanQual-manufactured tuples. The ROW_MARK_COPY path in EvalPlanQualFetchRowMarks() was just setting tableoid to InvalidOid, I think on the assumption that the referenced RTE must be a subquery or other case without a meaningful OID. However, foreign tables also use this code path, and they do have meaningful table OIDs; so failure to set the tuple field can lead to user-visible misbehavior. Fix that by fetching the appropriate OID from the range table. There's still an issue about whether CTID can ever have a meaningful value in this case; at least with postgres_fdw foreign tables, it does. But that is a different problem that seems to require a significantly different patch --- it's debatable whether postgres_fdw really wants to use this code path at all. Simplified version of a patch by Etsuro Fujita, who also noted the problem to begin with. The issue can be demonstrated in all versions having FDWs, so back-patch to 9.1. Branch ------ REL9_1_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/4a4fd2b0ceedb339118b0cf10ca78e472ce20a90 Modified Files -------------- src/backend/executor/execMain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2015-03-12 17:39 UTC | newest] Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2015-03-12 17:39 pgsql: Ensure tableoid reads correctly in EvalPlanQual-manufactured tup Tom Lane <tgl@sss.pgh.pa.us> 2015-03-12 17:39 pgsql: Ensure tableoid reads correctly in EvalPlanQual-manufactured tup Tom Lane <tgl@sss.pgh.pa.us> 2015-03-12 17:39 pgsql: Ensure tableoid reads correctly in EvalPlanQual-manufactured tup Tom Lane <tgl@sss.pgh.pa.us> 2015-03-12 17:39 pgsql: Ensure tableoid reads correctly in EvalPlanQual-manufactured tup Tom Lane <tgl@sss.pgh.pa.us> 2015-03-12 17:39 pgsql: Ensure tableoid reads correctly in EvalPlanQual-manufactured tup Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox