diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-03-23 19:53:52 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-03-23 19:53:52 +0000 |
| commit | 547b6e537aa8bbae83a8a4c4d0d7f216390bdb9c (patch) | |
| tree | 0a8e84561de60017cdbcb2080aa444706c1af404 /src/include/catalog | |
| parent | 4c35ec53a9e8e9c5496b2e33c6b568c0cfbdb7e3 (diff) | |
| download | postgresql-547b6e537aa8bbae83a8a4c4d0d7f216390bdb9c.tar.gz | |
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.
Diffstat (limited to 'src/include/catalog')
| -rw-r--r-- | src/include/catalog/namespace.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/include/catalog/namespace.h b/src/include/catalog/namespace.h index 490c4e5389..18e3157b9e 100644 --- a/src/include/catalog/namespace.h +++ b/src/include/catalog/namespace.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/namespace.h,v 1.44 2007/01/05 22:19:52 momjian Exp $ + * $PostgreSQL: pgsql/src/include/catalog/namespace.h,v 1.45 2007/03/23 19:53:52 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -32,6 +32,16 @@ typedef struct _FuncCandidateList Oid args[1]; /* arg types --- VARIABLE LENGTH ARRAY */ } *FuncCandidateList; /* VARIABLE LENGTH STRUCT */ +/* + * Structure for xxxOverrideSearchPath functions + */ +typedef struct OverrideSearchPath +{ + List *schemas; /* OIDs of explicitly named schemas */ + bool addCatalog; /* implicitly prepend pg_catalog? */ + bool addTemp; /* implicitly prepend temp schema? */ +} OverrideSearchPath; + extern Oid RangeVarGetRelid(const RangeVar *relation, bool failOK); extern Oid RangeVarGetCreationNamespace(const RangeVar *newRelation); @@ -72,8 +82,9 @@ extern bool isTempNamespace(Oid namespaceId); extern bool isAnyTempNamespace(Oid namespaceId); extern bool isOtherTempNamespace(Oid namespaceId); -extern void PushSpecialNamespace(Oid namespaceId); -extern void PopSpecialNamespace(Oid namespaceId); +extern OverrideSearchPath *GetOverrideSearchPath(MemoryContext context); +extern void PushOverrideSearchPath(OverrideSearchPath *newpath); +extern void PopOverrideSearchPath(void); extern Oid FindConversionByName(List *conname); extern Oid FindDefaultConversionProc(int4 for_encoding, int4 to_encoding); |
