2014-08-29 59 views
2

我已經知道如何設置每個數據庫或用戶的search_path(alter database set search_path to schema1,schema2,...)。如何將模式附加到postgresql數據庫的默認search_path?

我想要做的是將模式追加到默認的搜索路徑。我知道我可以得到當前的搜索路徑(show search_path),但在會話期間可能會改變它。

的目的是一樣的東西:

create schema postgis; 
set search_path to postgis; 
create extension postgis; 
alter database the_db set search_path to <the current default>, postgis; 

我可以手動做到這一點,但我想它添加到一個用戶改變了會話搜索路徑後,可以調用的函數。

+1

你是怎麼追加的? – codesmith 2017-04-20 15:51:21

回答

1

啊,找到它了。

對於我的目的,我可以做

set search_path to default; 

追加前。

相關問題