Switch to multi-inserts when registering dependencies for many code paths
authorMichael Paquier <michael@paquier.xyz>
Sat, 5 Sep 2020 12:33:53 +0000 (21:33 +0900)
committerMichael Paquier <michael@paquier.xyz>
Sat, 5 Sep 2020 12:33:53 +0000 (21:33 +0900)
commit8febfd1855450f50f17419def41c2ea9bcf994d5
tree50b6bf4ceca0742ae4be713d842e27d83df5f98e
parent11b80d900fe4297e8e4bc231f6a41b53d604ed9e
Switch to multi-inserts when registering dependencies for many code paths

This commit improves the dependency registrations by taking advantage of
the preliminary work done in 63110c62, to group together the insertion
of dependencies of the same type to pg_depend.  With the current layer
of routines available, and as only dependencies of the same type can be
grouped, there are code paths still doing more than one multi-insert
when it is necessary to register dependencies of multiple types
(constraint and index creation are two cases doing that).

While on it, this refactors some of the code to use ObjectAddressSet()
when manipulating object addresses.

Author: Daniel Gustafsson, Michael Paquier
Reviewed-by: Andres Freund, Álvaro Herrera
Discussion: https://postgr.es/m/20200807061619.GA23955@paquier.xyz
13 files changed:
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/catalog/pg_aggregate.c
src/backend/catalog/pg_cast.c
src/backend/catalog/pg_constraint.c
src/backend/catalog/pg_operator.c
src/backend/catalog/pg_proc.c
src/backend/catalog/pg_range.c
src/backend/catalog/pg_type.c
src/backend/commands/functioncmds.c
src/backend/commands/proclang.c
src/backend/commands/tsearchcmds.c
src/test/regress/expected/create_index.out