diff options
| author | Michael Paquier <michael@paquier.xyz> | 2020-07-01 17:03:50 +0900 |
|---|---|---|
| committer | Michael Paquier <michael@paquier.xyz> | 2020-07-01 17:03:50 +0900 |
| commit | 4315e8c23b9a897e12fcf91de7bfd734621096bf (patch) | |
| tree | 0162a7c0eb653b14a33ab6361714e8dbf38f5111 /src/backend/catalog/heap.c | |
| parent | a69e041d0c91759fb60ab52e7e21e3ec3752c69b (diff) | |
| download | postgresql-4315e8c23b9a897e12fcf91de7bfd734621096bf.tar.gz | |
Refactor ObjectAddress field assignments in more places
This is a follow-up commit similar to 68de144, with more places in the
backend code simplified with the macros able to assign values to the
fields of ObjectAddress. The code paths changed here could be
transitioned later into using more grouping when inserting dependency
records, simplifying this future work.
Author: Daniel Gustafsson, Michael Paquier
Discussion: https://postgr.es/m/20190213182737.mxn6hkdxwrzgxk35@alap3.anarazel.de
Diffstat (limited to 'src/backend/catalog/heap.c')
| -rw-r--r-- | src/backend/catalog/heap.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 3c83fe6bab..d279842d3c 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -818,21 +818,15 @@ AddNewAttributeTuples(Oid new_rel_oid, InsertPgAttributeTuple(rel, attr, (Datum) 0, indstate); /* Add dependency info */ - myself.classId = RelationRelationId; - myself.objectId = new_rel_oid; - myself.objectSubId = i + 1; - referenced.classId = TypeRelationId; - referenced.objectId = attr->atttypid; - referenced.objectSubId = 0; + ObjectAddressSubSet(myself, RelationRelationId, new_rel_oid, i + 1); + ObjectAddressSet(referenced, TypeRelationId, attr->atttypid); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); /* The default collation is pinned, so don't bother recording it */ if (OidIsValid(attr->attcollation) && attr->attcollation != DEFAULT_COLLATION_OID) { - referenced.classId = CollationRelationId; - referenced.objectId = attr->attcollation; - referenced.objectSubId = 0; + ObjectAddressSet(referenced, CollationRelationId, attr->attcollation); recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); } } |
