Fix plancache so that any required replanning is done with the same
Tom Lane <tgl@sss.pgh.pa.us>
Fix plancache so that any required replanning is done with the same search_path that was active when the plan was first made. To do this, improve namespace.c to support a stack of "override" search path settings (we must have a stack since nested replan events are entirely possible). This facility replaces the "special namespace" hack formerly used by CREATE SCHEMA, and should be able to support per-function search path settings as well.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/namespace.c | modified | +270 −105 |
| src/backend/commands/schemacmds.c | modified | +7 −3 |
| src/backend/utils/cache/plancache.c | modified | +27 −1 |
| src/include/catalog/namespace.h | modified | +14 −3 |
| src/include/utils/plancache.h | modified | +2 −1 |
| src/test/regress/expected/plancache.out | modified | +39 −0 |
| src/test/regress/sql/plancache.sql | modified | +30 −0 |