From 3e938a83b2ee3b47d47cdbdf58df09946877d4fd Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Sat, 2 Feb 2019 13:23:26 +0900 Subject: [PATCH] Improve installation instructions with pg_ctl in documentation The documentation includes sections to be able to initialize and start Postgres via a couple of commands. Some of its recommendations involve using directly "postgres", which is inconsistent with the recommendation given by initdb. At the same time make some other command calls more consistent with the rest, by using an absolute path when creating a database. Author: Andreas Scherbaum Reviewed-by: Michael Banck, Ryan Lambert --- doc/src/sgml/installation.sgml | 2 +- doc/src/sgml/standalone-install.xml | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index ee518fb9b6..449386243b 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -37,7 +37,7 @@ mkdir /usr/local/pgsql/data chown postgres /usr/local/pgsql/data su - postgres /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data -/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 & +/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start /usr/local/pgsql/bin/createdb test /usr/local/pgsql/bin/psql test diff --git a/doc/src/sgml/standalone-install.xml b/doc/src/sgml/standalone-install.xml index 62582effed..f584789f9a 100644 --- a/doc/src/sgml/standalone-install.xml +++ b/doc/src/sgml/standalone-install.xml @@ -77,25 +77,21 @@ postgres$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/datainitdb step should have told you how to start up the database server. Do so now. The command should look something like: -/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data - This will start the server in the foreground. To put the server - in the background use something like: -nohup /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data \ - </dev/null >>server.log 2>&1 </dev/null & +/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data start To stop a server running in the background you can type: -kill `cat /usr/local/pgsql/data/postmaster.pid` +/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data stop Create a database: -createdb testdb +/usr/local/pgsql/bin/createdb testdb Then enter: -psql testdb +/usr/local/pgsql/bin/psql testdb to connect to that database. At the prompt you can enter SQL commands and start experimenting. -- 2.40.0