diff options
| author | Bruce Momjian <bruce@momjian.us> | 2013-01-26 13:24:50 -0500 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2013-01-26 13:24:50 -0500 |
| commit | 7e2322dff30c04d90c0602d2b5ae24b4881db88b (patch) | |
| tree | 572a13afcce06ae50c73787058d66729540d7992 /src/backend/commands | |
| parent | 7c83619b50c8f8a6d75105636e3ca63a9d2eb7a9 (diff) | |
| download | postgresql-7e2322dff30c04d90c0602d2b5ae24b4881db88b.tar.gz | |
Allow CREATE TABLE IF EXIST so succeed if the schema is nonexistent
Previously, CREATE TABLE IF EXIST threw an error if the schema was
nonexistent. This was done by passing 'missing_ok' to the function that
looks up the schema oid.
Diffstat (limited to 'src/backend/commands')
| -rw-r--r-- | src/backend/commands/indexcmds.c | 2 | ||||
| -rw-r--r-- | src/backend/commands/opclasscmds.c | 4 | ||||
| -rw-r--r-- | src/backend/commands/trigger.c | 3 |
3 files changed, 5 insertions, 4 deletions
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 94efd13989..c3385a113a 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -1264,7 +1264,7 @@ GetIndexOpClass(List *opclass, Oid attrType, /* Look in specific schema only */ Oid namespaceId; - namespaceId = LookupExplicitNamespace(schemaname); + namespaceId = LookupExplicitNamespace(schemaname, false); tuple = SearchSysCache3(CLAAMNAMENSP, ObjectIdGetDatum(accessMethodId), PointerGetDatum(opcname), diff --git a/src/backend/commands/opclasscmds.c b/src/backend/commands/opclasscmds.c index 2cfd89a7f9..95b9a738fe 100644 --- a/src/backend/commands/opclasscmds.c +++ b/src/backend/commands/opclasscmds.c @@ -103,7 +103,7 @@ OpFamilyCacheLookup(Oid amID, List *opfamilyname, bool missing_ok) /* Look in specific schema only */ Oid namespaceId; - namespaceId = LookupExplicitNamespace(schemaname); + namespaceId = LookupExplicitNamespace(schemaname, false); htup = SearchSysCache3(OPFAMILYAMNAMENSP, ObjectIdGetDatum(amID), PointerGetDatum(opfname), @@ -179,7 +179,7 @@ OpClassCacheLookup(Oid amID, List *opclassname, bool missing_ok) /* Look in specific schema only */ Oid namespaceId; - namespaceId = LookupExplicitNamespace(schemaname); + namespaceId = LookupExplicitNamespace(schemaname, false); htup = SearchSysCache3(CLAAMNAMENSP, ObjectIdGetDatum(amID), PointerGetDatum(opcname), diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index f11a8ec5d4..c0322b7bec 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -4226,7 +4226,8 @@ AfterTriggerSetState(ConstraintsSetStmt *stmt) */ if (constraint->schemaname) { - Oid namespaceId = LookupExplicitNamespace(constraint->schemaname); + Oid namespaceId = LookupExplicitNamespace(constraint->schemaname, + false); namespacelist = list_make1_oid(namespaceId); } |
