File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 425425 # }
426426 case $_object_name {
427427 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+ }
430432 # Never put double quotes into has_*_privilege function
431433 $_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]
432436 }
433437 default: {
434438 $_granted_object = $_object_name
449453 }
450454
451455 $_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} }'" ,
454458 ' 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} '" ,
456460 default => undef ,
457461 }
458462
You can’t perform that action at this time.
0 commit comments