diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2020-12-09 15:12:05 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2020-12-09 15:41:45 +0100 |
commit | 8b069ef5dca97cd737a5fd64c420df3cd61ec1c9 (patch) | |
tree | 003a455f78a362610fdced6c4ad8be1ac846ba4d /src/backend/utils/adt/ruleutils.c | |
parent | 16c302f51235eaec05a1f85a11c1df04ef3a6785 (diff) | |
download | postgresql-8b069ef5dca97cd737a5fd64c420df3cd61ec1c9.tar.gz postgresql-8b069ef5dca97cd737a5fd64c420df3cd61ec1c9.zip |
Change get_constraint_index() to use pg_constraint.conindid
It was still using a scan of pg_depend instead of using the conindid
column that has been added since.
Since it is now just a catalog lookup wrapper and not related to
pg_depend, move from pg_depend.c to lsyscache.c.
Reviewed-by: Matthias van de Meent <boekewurm+postgres@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://www.postgresql.org/message-id/flat/4688d55c-9a2e-9a5a-d166-5f24fe0bf8db%40enterprisedb.com
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
-rw-r--r-- | src/backend/utils/adt/ruleutils.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index c2c6df2a4f7..ad582f99a5a 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -24,7 +24,6 @@ #include "access/relation.h" #include "access/sysattr.h" #include "access/table.h" -#include "catalog/dependency.h" #include "catalog/pg_aggregate.h" #include "catalog/pg_am.h" #include "catalog/pg_authid.h" @@ -2140,7 +2139,7 @@ pg_get_constraintdef_worker(Oid constraintId, bool fullCommand, appendStringInfoChar(&buf, ')'); - indexId = get_constraint_index(constraintId); + indexId = conForm->conindid; /* Build including column list (from pg_index.indkeys) */ indtup = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexId)); |