pg_ctl 是一個用於啟動、停止, 或重啟 PostgreSQL 後端伺服器,及顯示伺服器的狀態的工具。

Synopsis
pg_ctl start | stop | reload | status | restart [-D data_dir]

-D data_dir
聲明該資料庫文件的文件系統位置。 如果忽略這個選項,使用環境變量 PGDATA。

Note: 使用此命令前,請先將使用者切換至PostgreSQL super user(postgres)。

啟動伺服器:
$ pg_ctl start

停止伺服器:
$ pg_ctl stop

重啟伺服器:
$ pg_ctl restart

顯示伺服器狀態:
$ pg_ctl status
pg_ctl: postmaster is running (pid: 15718)
Command line was:
/usr/bin/postmaster '-D' '/var/lib/pgsql/data' '-p' '5433' '-B' '128'

arrow
arrow
    文章標籤
    postmaster postgresql
    全站熱搜

    mark528 發表在 痞客邦 留言(0) 人氣()