启动、登录和关闭PostgreSQL

  1. 切换到postgres用户。
    su - postgres
  2. 启动数据库。
    /usr/local/pgsql/bin/pg_ctl -D /data/pgsql/data/ -l logfile start

  3. 查看数据库进程,确认是否启动(如下图所示,则启动成功)。

  1. 切换到postgres用户。
    su - postgres
  2. 登录数据库。
    /usr/local/pgsql/bin/psql -U postgres