Remove direct call to GetNewObjectId() for pg_auth_members.oid
authorMichael Paquier <[email protected]>
Mon, 12 Dec 2022 00:01:39 +0000 (09:01 +0900)
committerMichael Paquier <[email protected]>
Mon, 12 Dec 2022 00:01:39 +0000 (09:01 +0900)
This routine should not be called directly as mentioned at its top, so
replace it by GetNewOidWithIndex().  Issue introduced by 6566133 when
pg_auth_members.oid got added, so no backpatch is needed.

Author: Maciek Sakrejda
Discussion: https://postgr.es/m/CAOtHd0Ckbih7Ur7XeVyLAJ26VZOfTNcq9qV403bNF4uTGtAN+Q@mail.gmail.com

src/backend/commands/user.c

index 8b6543edee213319ed77882a8fe2624bb5f29dd8..0686807fa0a61e40258a96d2b15f065fe613a266 100644 (file)
@@ -1850,7 +1850,8 @@ AddRoleMems(const char *rolename, Oid roleid,
                        }
 
                        /* get an OID for the new row and insert it */
-                       objectId = GetNewObjectId();
+                       objectId = GetNewOidWithIndex(pg_authmem_rel, AuthMemOidIndexId,
+                                                                                 Anum_pg_auth_members_oid);
                        new_record[Anum_pg_auth_members_oid - 1] = objectId;
                        tuple = heap_form_tuple(pg_authmem_dsc,
                                                                        new_record, new_record_nulls);