Skip to content

Commit

Permalink
Fix builds of set_user for PG12
Browse files Browse the repository at this point in the history
  • Loading branch information
gitstashpop authored and mpalmi committed Feb 28, 2019
1 parent c7157eb commit bfb8182
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions set_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,12 @@ set_user(PG_FUNCTION_ARGS)
if (!HeapTupleIsValid(roleTup))
elog(ERROR, "role \"%s\" does not exist", newuser);

/* OID column is removed in PG12 */
#if PG_VERSION_NUM >= 120000
NewUserId = ((Form_pg_authid) GETSTRUCT(roleTup))->oid;
#else
NewUserId = HeapTupleGetOid(roleTup);
#endif
NewUser_is_superuser = ((Form_pg_authid) GETSTRUCT(roleTup))->rolsuper;
ReleaseSysCache(roleTup);

Expand Down

0 comments on commit bfb8182

Please sign in to comment.