1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

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.
This commit is contained in:
Bruce Momjian
2013-01-26 13:24:50 -05:00
parent 7c83619b50
commit 7e2322dff3
9 changed files with 68 additions and 41 deletions

View File

@ -1027,7 +1027,7 @@ make_oper_cache_key(OprCacheKey *key, List *opname, Oid ltypeId, Oid rtypeId)
if (schemaname)
{
/* search only in exact schema given */
key->search_path[0] = LookupExplicitNamespace(schemaname);
key->search_path[0] = LookupExplicitNamespace(schemaname, false);
}
else
{

View File

@ -149,7 +149,7 @@ LookupTypeName(ParseState *pstate, const TypeName *typeName,
/* Look in specific schema only */
Oid namespaceId;
namespaceId = LookupExplicitNamespace(schemaname);
namespaceId = LookupExplicitNamespace(schemaname, false);
typoid = GetSysCacheOid2(TYPENAMENSP,
PointerGetDatum(typname),
ObjectIdGetDatum(namespaceId));