89
89
DefineUser (CreateUserStmt * stmt )
90
90
{
91
91
92
- char * pg_user ;
92
+ char * pg_shadow ;
93
93
Relation pg_shadow_rel ;
94
94
TupleDesc pg_shadow_dsc ;
95
95
HeapScanDesc scan ;
@@ -112,12 +112,12 @@ DefineUser(CreateUserStmt *stmt)
112
112
* Make sure the user attempting to create a user can insert into the
113
113
* pg_shadow relation.
114
114
*/
115
- pg_user = GetPgUserName ();
116
- if (pg_aclcheck (ShadowRelationName , pg_user , ACL_RD | ACL_WR | ACL_AP ) != ACLCHECK_OK )
115
+ pg_shadow = GetPgUserName ();
116
+ if (pg_aclcheck (ShadowRelationName , pg_shadow , ACL_RD | ACL_WR | ACL_AP ) != ACLCHECK_OK )
117
117
{
118
118
UserAbortTransactionBlock ();
119
119
elog (ERROR , "defineUser: user \"%s\" does not have SELECT and INSERT privilege for \"%s\"" ,
120
- pg_user , ShadowRelationName );
120
+ pg_shadow , ShadowRelationName );
121
121
return ;
122
122
}
123
123
@@ -220,7 +220,7 @@ extern void
220
220
AlterUser (AlterUserStmt * stmt )
221
221
{
222
222
223
- char * pg_user ;
223
+ char * pg_shadow ;
224
224
Relation pg_shadow_rel ;
225
225
TupleDesc pg_shadow_dsc ;
226
226
HeapScanDesc scan ;
@@ -242,12 +242,12 @@ AlterUser(AlterUserStmt *stmt)
242
242
* Make sure the user attempting to create a user can insert into the
243
243
* pg_shadow relation.
244
244
*/
245
- pg_user = GetPgUserName ();
246
- if (pg_aclcheck (ShadowRelationName , pg_user , ACL_RD | ACL_WR ) != ACLCHECK_OK )
245
+ pg_shadow = GetPgUserName ();
246
+ if (pg_aclcheck (ShadowRelationName , pg_shadow , ACL_RD | ACL_WR ) != ACLCHECK_OK )
247
247
{
248
248
UserAbortTransactionBlock ();
249
249
elog (ERROR , "alterUser: user \"%s\" does not have SELECT and UPDATE privilege for \"%s\"" ,
250
- pg_user , ShadowRelationName );
250
+ pg_shadow , ShadowRelationName );
251
251
return ;
252
252
}
253
253
@@ -347,7 +347,7 @@ extern void
347
347
RemoveUser (char * user )
348
348
{
349
349
350
- char * pg_user ;
350
+ char * pg_shadow ;
351
351
Relation pg_shadow_rel ,
352
352
pg_rel ;
353
353
TupleDesc pg_dsc ;
@@ -369,12 +369,12 @@ RemoveUser(char *user)
369
369
* Make sure the user attempting to create a user can delete from the
370
370
* pg_shadow relation.
371
371
*/
372
- pg_user = GetPgUserName ();
373
- if (pg_aclcheck (ShadowRelationName , pg_user , ACL_RD | ACL_WR ) != ACLCHECK_OK )
372
+ pg_shadow = GetPgUserName ();
373
+ if (pg_aclcheck (ShadowRelationName , pg_shadow , ACL_RD | ACL_WR ) != ACLCHECK_OK )
374
374
{
375
375
UserAbortTransactionBlock ();
376
376
elog (ERROR , "removeUser: user \"%s\" does not have SELECT and DELETE privilege for \"%s\"" ,
377
- pg_user , ShadowRelationName );
377
+ pg_shadow , ShadowRelationName );
378
378
return ;
379
379
}
380
380
@@ -463,7 +463,7 @@ RemoveUser(char *user)
463
463
* tables, views, etc owned by the user.
464
464
*
465
465
* The second option would be to create a means of deleting tables, view,
466
- * etc. owned by the user from other databases. Pg_user is global and
466
+ * etc. owned by the user from other databases. pg_shadow is global and
467
467
* so this must be done at some point.
468
468
*
469
469
* Let us not forget that the user should be removed from the pg_groups
0 commit comments