Permission denied on function after schema copy
1
vote
1
answer
1714
views
I had one schema 'public' and simple function in the schema named 'isvalidoption'.
What was done:
- backup schema using pg_dump;
- rename schema to 'development';
- create new schema 'public';
- restore it from backup using pg_restore.
The problem:
- when I select from any table omitting schema prefix like 'SELECT *
FROM mytable;' it's OK
- when I run function with schema prefix like 'SELECT public.isvalidoption();' or 'SELECT development.isvalidoption()' it's OK;
- when I run function omitting schema prefix like 'SELECT isvalidoption();' **I get ERROR: permission denied for function isvalidoption**
User has USAGE on both schemas and EXECUTE on function in both schemas also he is owner of the function in both schemas.
PostgreSQL version is 9.6.1.
'SELECT current_user;' shows correct user.
'SHOW search_path;' shows '"$user", public'.
Any ideas?
Asked by Roman Shevtsiv
(121 rep)
Feb 11, 2017, 02:39 PM
Last activity: Feb 11, 2017, 05:16 PM
Last activity: Feb 11, 2017, 05:16 PM