PostgreSQL search_path change not working as advertised
I just tested it on (just releases) 9.1 on Windows 64-bit and it worked as specified.
Excerpt from the ALTER ROLE
manpage:
The remaining variants change a role's session default for a configuration variable, either for all databases or, when the IN DATABASE clause is specified, only for sessions in the named database. Whenever the role subsequently starts a new session, the specified value becomes the session default, overriding whatever setting is present in postgresql.conf or has been received from the postgres command line. This only happens at login time; executing SET ROLE or SET SESSION AUTHORIZATION does not cause new configuration values to be set.
(emphasis mine)
GRANT
might solve your problem:
GRANT USAGE ON SCHEMA wh TO django;
(Or GRANT USAGE ...
to any role which has django as a (direct or indirect) member.)
(Or GRANT ALL ...
if that is what you want.)
Setting the search_path
instructs Postgres to look for objects in the listed schemas. It does not grant permission to see what's there. If "django" does not have the necessary privileges, \dt
must not (and does not) show that information.
On the other hand, if you have already tried as superuser (as per your comment on the previous suggestion), then this might not be it ...