postgresql - Grant EXECUTE to many PostGIS functions -
i have web application based on mapserver, uses postgis underlying database extension. want have dedicated database role used mapserver, cause don't want access database via postgres superuser. role should have select permission on public tables (which easy achieve) , execute permissions on public postgis functions.
several questions arise: postgis relevant functions stored in public schema of database or there else consider?
how can extract functions information - i.e. function name, number , names of arguments - information_schema or pg_catalog of database?! need information grant execute on function(args) mapserveruser statements!
thank in advance!!!
in postgresql 8.4.x:
select n.nspname "schema", p.proname "name", pg_catalog.pg_get_function_result(p.oid) "result data type", pg_catalog.pg_get_function_arguments(p.oid) "argument data types", case when p.proisagg 'agg' when p.proiswindow 'window' when p.prorettype = 'pg_catalog.trigger'::pg_catalog.regtype 'trigger' else 'normal' end "type" pg_catalog.pg_proc p left join pg_catalog.pg_namespace n on n.oid = p.pronamespace pg_catalog.pg_function_is_visible(p.oid) , n.nspname <> 'pg_catalog' , n.nspname <> 'information_schema' order 1, 2, 4;
found running psql -e parameter (show hidden queries) , running \df command.
also, "public" schema in postgresql named way. carries no special meaning. it's bad name. need out "public" role (all caps). while tables not automatically granted public role, experience public automatically gets execute permission on functions defined security invoker.
Comments
Post a Comment