Skip to content

Commit 3e938a8

Browse files
committed
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
1 parent 558d77f commit 3e938a8

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

doc/src/sgml/installation.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ mkdir /usr/local/pgsql/data
3737
chown postgres /usr/local/pgsql/data
3838
su - postgres
3939
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
40-
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
40+
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
4141
/usr/local/pgsql/bin/createdb test
4242
/usr/local/pgsql/bin/psql test
4343
</synopsis>

doc/src/sgml/standalone-install.xml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,25 +77,21 @@ postgres$ <userinput>/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data</useri
7777
The previous <command>initdb</command> step should have told you how to
7878
start up the database server. Do so now. The command should look
7979
something like:
80-
<programlisting>/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data</programlisting>
81-
This will start the server in the foreground. To put the server
82-
in the background use something like:
83-
<programlisting>nohup /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data \
84-
&lt;/dev/null &gt;&gt;server.log 2&gt;&amp;1 &lt;/dev/null &amp;</programlisting>
80+
<programlisting>/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data start</programlisting>
8581
</para>
8682

8783
<para>
8884
To stop a server running in the background you can type:
89-
<programlisting>kill `cat /usr/local/pgsql/data/postmaster.pid`</programlisting>
85+
<programlisting>/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data stop</programlisting>
9086
</para>
9187
</step>
9288

9389
<step>
9490
<para>
9591
Create a database:
96-
<screen><userinput>createdb testdb</userinput></screen>
92+
<screen><userinput>/usr/local/pgsql/bin/createdb testdb</userinput></screen>
9793
Then enter:
98-
<screen><userinput>psql testdb</userinput></screen>
94+
<screen><userinput>/usr/local/pgsql/bin/psql testdb</userinput></screen>
9995
to connect to that database. At the prompt you can enter SQL
10096
commands and start experimenting.
10197
</para>

0 commit comments

Comments
 (0)