mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
Allow composite types in catalog bootstrap
When resolving types during catalog bootstrap, try to reload the pg_type contents if a type is not found. That allows catalogs to contain composite types, e.g. row types for other catalogs. Author: Justin Pryzby Reviewed-by: Dean Rasheed, Tomas Vondra Discussion: https://postgr.es/m/ad7891d2-e90c-b446-9fe2-7419143847d7%40enterprisedb.com
This commit is contained in:
parent
e1a5e65703
commit
79f6a942bd
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user