2014-03-05 56 views

回答

16
postgresql-9.3.3-1-windows-x64.exe --unattendedmodeui minimal --mode unattended --superpassword "password" --servicename "postgreSQL" 
--servicepassword "password" --serverport 5432 

值得一提postgresql-9.3.3-1-windows-x64.exe --help將提供可以使用的選項和默認值列表。

9

Run the installer in unattended(silent) mode

- 或 -

download the plain binariesinitdb一個新的datadir,然後用pg_ctl啓動服務器。您可以使用標準Windows工具(如sc)安裝服務,也可以使用pg_ctl register創建服務。

如果您計劃捆綁的PostgreSQL在應用程序中,使用後一種方法(二進制zip文件),確保你不是默認端口5432之外的端口上運行它,那麼你的應用程序並不衝突用戶可以自己做任何安裝。

+0

我獨家使用ZIP分佈。與安裝程序 –

+0

相比,以這種方式安裝Postgres似乎要快得多(而且更簡單 - 至少對我來說)是的。我傾向於使用Fedora的PGDG包和源代碼版本的混合。使用Windows安裝程序(在Windows上)的主要好處是它可以爲您提供psqlODBC等,但這不是手動操作太困難。 –

+1

您可能想要添加一件事:您可以使用'pg_ctl register ...'創建Windows服務,您不需要'sc'。 –

相關問題