diff options
Diffstat (limited to 'src/backend/commands')
-rw-r--r-- | src/backend/commands/typecmds.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/backend/commands/typecmds.c b/src/backend/commands/typecmds.c index 12388004d98..66f7c577267 100644 --- a/src/backend/commands/typecmds.c +++ b/src/backend/commands/typecmds.c @@ -2179,6 +2179,9 @@ AlterDomainDefault(List *names, Node *defaultRaw) Relation rel; char *defaultValue; Node *defaultExpr = NULL; /* NULL if no default specified */ + Acl *typacl; + Datum aclDatum; + bool isNull; Datum new_record[Natts_pg_type]; bool new_record_nulls[Natts_pg_type]; bool new_record_repl[Natts_pg_type]; @@ -2270,25 +2273,23 @@ AlterDomainDefault(List *names, Node *defaultRaw) CatalogTupleUpdate(rel, &tup->t_self, newtuple); + /* Must extract ACL for use of GenerateTypeDependencies */ + aclDatum = heap_getattr(newtuple, Anum_pg_type_typacl, + RelationGetDescr(rel), &isNull); + if (isNull) + typacl = NULL; + else + typacl = DatumGetAclPCopy(aclDatum); + /* Rebuild dependencies */ - GenerateTypeDependencies(typTup->typnamespace, - domainoid, - InvalidOid, /* typrelid is n/a */ + GenerateTypeDependencies(domainoid, + (Form_pg_type) GETSTRUCT(newtuple), + defaultExpr, + typacl, 0, /* relation kind is n/a */ - typTup->typowner, - typTup->typinput, - typTup->typoutput, - typTup->typreceive, - typTup->typsend, - typTup->typmodin, - typTup->typmodout, - typTup->typanalyze, - InvalidOid, false, /* a domain isn't an implicit array */ - typTup->typbasetype, - typTup->typcollation, - defaultExpr, - true); /* Rebuild is true */ + false, /* nor is it any kind of dependent type */ + true); /* We do need to rebuild dependencies */ InvokeObjectPostAlterHook(TypeRelationId, domainoid, 0); |