set search_path is not working for some users in PostgreSQL
To reproduce:
1. Open ADS and navigate to postgresql 9.2 server at 11.56 and login as sys. Open a new Query Window
2. Open ADS and navigate to postgresql 9.2 server at 11.56 and login as ivan.Open a new Query Window
Execute the below queries in both the windows.
3. For the user sys, even though the current search_path is returned as jonathan, the name near the drop down is still public and any select to the jonathan schema returns an error. See attached screen shot
set search_path = jonathan
go
show search_path
go
select * from jon
go
As designed. Msg is returned from the driver. The user does not have permissions to that schema but when you don't qualify the object the database will try to find the object in all the schemas listed in the search path. It doesn't find it because the user doesn't have permissions but it doesn't since it was not qualified, the driver just says not found in any of the schemas in the search path. If you where to qualify the object you will see the user doesn't have permissions and the driver will let you know because its looking at a single path.
Issue #9095 |
Closed |
Invalid |
Resolved |
Completion |
No due date |
No fixed build |
No time estimate |
1 issue link |
relates to #344
Issue #344PostgreSQL: Add the ability to change the schema context. |
As designed. Msg is returned from the driver. The user does not have permissions to that schema but when you don't qualify the object the database will try to find the object in all the schemas listed in the search path. It doesn't find it because the user doesn't have permissions but it doesn't since it was not qualified, the driver just says not found in any of the schemas in the search path. If you where to qualify the object you will see the user doesn't have permissions and the driver will let you know because its looking at a single path.