postgres=# show search_path;
search_path
-----------------
"$user", public
(1 row)
默認值是$user,public,意思就是當以某個用戶登錄到數據庫的時候,默認就是先查找和登錄用戶同名的schema,再查找public。
修改search_path:
postgres=# set search_path = schema_name1,schema_name2,...;
或者
postgres=# set search_path to schema_name1,schema_name2,...;
恢復:
postgres=# set search_path = "$user", public;