File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 425
425
# }
426
426
case $_object_name {
427
427
Array: {
428
- # pg_* views does not contain schema name as part of the object name
429
- $_togrant_object = $_object_name
428
+ $_togrant_object = $_enquote_object ? {
429
+ false => join($_object_name, ' .' ),
430
+ default => join($_object_name, ' "."' ),
431
+ }
430
432
# Never put double quotes into has_*_privilege function
431
433
$_granted_object = join($_object_name, ' .' )
434
+ # pg_* views does not contain schema name as part of the object name
435
+ $_togrant_object_only = $_object_name[1]
432
436
}
433
437
default: {
434
438
$_granted_object = $_object_name
449
453
}
450
454
451
455
$_onlyif = $onlyif_function ? {
452
- ' table_exists' => " SELECT true FROM pg_tables WHERE tablename = '${_togrant_object }'" ,
453
- ' language_exists' => " SELECT true from pg_language WHERE lanname = '${_togrant_object }'" ,
456
+ ' table_exists' => " SELECT true FROM pg_tables WHERE tablename = '${_togrant_object_only }'" ,
457
+ ' language_exists' => " SELECT true from pg_language WHERE lanname = '${_togrant_object_only} }'" ,
454
458
' role_exists' => " SELECT 1 FROM pg_roles WHERE rolname = '${role} ' or '${role} ' = 'PUBLIC'" ,
455
- ' function_exists' => " SELECT true FROM pg_proc WHERE (oid::regprocedure)::text = '${_togrant_object }${arguments} '" ,
459
+ ' function_exists' => " SELECT true FROM pg_proc WHERE (oid::regprocedure)::text = '${_togrant_object_only} }${arguments} '" ,
456
460
default => undef ,
457
461
}
458
462
You can’t perform that action at this time.
0 commit comments