aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/bootstrap/bootstrap.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c
index 52d36ae1a28..dce7088e6bb 100644
--- a/src/backend/bootstrap/bootstrap.c
+++ b/src/backend/bootstrap/bootstrap.c
@@ -934,6 +934,29 @@ gettype(char *type)
return app->am_oid;
}
}
+
+ /*
+ * The type wasn't known; reload the pg_type contents and check again
+ * to handle composite types, added since last populating the list.
+ */
+
+ list_free_deep(Typ);
+ Typ = NIL;
+ populate_typ_list();
+
+ /*
+ * Calling gettype would result in infinite recursion for types missing
+ * in pg_type, so just repeat the lookup.
+ */
+ foreach (lc, Typ)
+ {
+ struct typmap *app = lfirst(lc);
+ if (strncmp(NameStr(app->am_typ.typname), type, NAMEDATALEN) == 0)
+ {
+ Ap = app;
+ return app->am_oid;
+ }
+ }
}
else
{