0

I am using postgresql. I have created a user and grant access on db. I want user can only see granted schema objects and rest database/schema objects can't watchable. Please guide me.

irfan_db
  • 9
  • 5

1 Answers1

0

You need to alter the user and set the search path.

ALTER USER foo SET search_path TO '$newschema,pg_catalog';

Note that in order to get a proper backup of globals such as this you have to use pg_dumpall -g, not pg_dump. Obviously a base backup will have them as well.

Joshua D. Drake
  • 996
  • 4
  • 6
  • alter user ali set search_path TO 'usman'; still not working and ali able to see other schema objects. – irfan_db Sep 02 '15 at 15:58
  • You can not completely remove other schema visibility on its own. You need search_path plus a series of GRANT/REVOKE statements. – Joshua D. Drake Sep 04 '15 at 18:45