diff options
author | Michael Paquier <michael@paquier.xyz> | 2023-07-20 15:18:25 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2023-07-20 15:18:25 +0900 |
commit | 2a990abd79acea4717cc8f982a28f35b6b347ddb (patch) | |
tree | 2a5b181b6d75fe5cd20367a327cd80f7e0cca868 /src/backend/utils/cache/partcache.c | |
parent | 47556a0013fa64d44add2760577d49cf2eca4cd0 (diff) | |
download | postgresql-2a990abd79acea4717cc8f982a28f35b6b347ddb.tar.gz postgresql-2a990abd79acea4717cc8f982a28f35b6b347ddb.zip |
Add missing ObjectIdGetDatum() in syscache lookup calls for Oids
Based on how postgres.h foes the Oid <-> Datum conversion, there is no
existing bugs but let's be consistent. 17 spots have been noticed as
incorrectly passing down Oids rather than Datums. Aleksander got one,
Zhang two and I the rest.
Author: Michael Paquier, Aleksander Alekseev, Zhang Mingli
Discussion: https://postgr.es/m/ZLUhqsqQN1MOaxdw@paquier.xyz
Diffstat (limited to 'src/backend/utils/cache/partcache.c')
-rw-r--r-- | src/backend/utils/cache/partcache.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/utils/cache/partcache.c b/src/backend/utils/cache/partcache.c index 5f3516ad0c2..c6c0d5a00f6 100644 --- a/src/backend/utils/cache/partcache.c +++ b/src/backend/utils/cache/partcache.c @@ -365,7 +365,8 @@ generate_partition_qual(Relation rel) parent = relation_open(parentrelid, AccessShareLock); /* Get pg_class.relpartbound */ - tuple = SearchSysCache1(RELOID, RelationGetRelid(rel)); + tuple = SearchSysCache1(RELOID, + ObjectIdGetDatum(RelationGetRelid(rel))); if (!HeapTupleIsValid(tuple)) elog(ERROR, "cache lookup failed for relation %u", RelationGetRelid(rel)); |