Installation instructions update (pg_ctl)

Started by Andreas 'ads' Scherbaumalmost 8 years ago7 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t39587
psql -h localhost -U postgres

Built from patchset v3 (message #3), July 28, 2026 at 05:03 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t39587_3 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t39587_3 && git checkout t39587_3

Patchset v3 (message #3) is on t39587_3

Jump to latest
#1Andreas 'ads' Scherbaum
adsmail@wars-nicht.de

Hello,

The installation instructions (short version) are not consistent with
the "initdb" output. The first one still uses "postgres -D", even
mentions "check initdb output", but "initdb" emits "pg_ctl" commands.

The attached patch updates the short install instructions and replaces
"postgres -D" with "pg_ctl" calls.

The long version is left as it is, because it describes both "postgres
-D" and "pg_ctl" as a wrapper.

Regards,

--
Andreas 'ads' Scherbaum
German PostgreSQL User Group
European PostgreSQL User Group - Board of Directors
Volunteer Regional Contact, Germany - PostgreSQL Project

Attachments:

pg_ctl.difftext/x-patch; name=pg_ctl.diffDownload+6-10
#2Michael Banck
michael.banck@credativ.de
In reply to: Andreas 'ads' Scherbaum (#1)
Re: Installation instructions update (pg_ctl)

Hi,

On Tue, Oct 30, 2018 at 12:08:49AM +0100, Andreas 'ads' Scherbaum wrote:

The installation instructions (short version) are not consistent with the
"initdb" output. The first one still uses "postgres -D", even mentions
"check initdb output", but "initdb" emits "pg_ctl" commands.

The attached patch updates the short install instructions and replaces
"postgres -D" with "pg_ctl" calls.

Check.

diff --git a/doc/src/sgml/standalone-install.xml b/doc/src/sgml/standalone-install.xml
index 62582effed..b5d2835a47 100644
--- a/doc/src/sgml/standalone-install.xml
+++ b/doc/src/sgml/standalone-install.xml
@@ -50,7 +50,7 @@ in the stand-alone version.

That one though seems to be what's ending up in INSTALL, according to
the comment at the beginning of the file.

<screen>root# <userinput>mkdir /usr/local/pgsql/data</userinput>
root# <userinput>chown postgres /usr/local/pgsql/data</userinput>
root# <userinput>su - postgres</userinput>
-postgres$ <userinput>/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data</userinput></screen>
+postgres$ <userinput>/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data</userinput></screen>
</para>

I'm confused here, the paragraph reads "Create a database installation
with the <command>initdb</command>", so I think this hunk is not
correct and should be removed?

@@ -77,25 +77,21 @@ postgres$ <userinput>/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data</useri
The previous <command>initdb</command> step should have told you how to
start up the database server. Do so now. The command should look
something like:
-<programlisting>/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data</programlisting>
-     This will start the server in the foreground. To put the server
-     in the background use something like:
-<programlisting>nohup /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data \
-    &lt;/dev/null &gt;&gt;server.log 2&gt;&amp;1 &lt;/dev/null &amp;</programlisting>
+<programlisting>/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data start</programlisting>
</para>
<para>
To stop a server running in the background you can type:
-<programlisting>kill `cat /usr/local/pgsql/data/postmaster.pid`</programlisting>
+<programlisting>/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data stop</programlisting>
</para>
</step>
<step>
<para>
Create a database:
-<screen><userinput>createdb testdb</userinput></screen>
+<screen><userinput>/usr/local/pgsql/bin/createdb testdb</userinput></screen>
Then enter:
-<screen><userinput>psql testdb</userinput></screen>
+<screen><userinput>/usr/local/pgsql/bin/psql testdb</userinput></screen>
to connect to that database. At the prompt you can enter SQL
commands and start experimenting.
</para>

Check.

Michael

--
Michael Banck
Projektleiter / Senior Berater
Tel.: +49 2166 9901-171
Fax: +49 2166 9901-100
Email: michael.banck@credativ.de

credativ GmbH, HRB M�nchengladbach 12080
USt-ID-Nummer: DE204566209
Trompeterallee 108, 41189 M�nchengladbach
Gesch�ftsf�hrung: Dr. Michael Meskes, J�rg Folz, Sascha Heuer

Unser Umgang mit personenbezogenen Daten unterliegt
folgenden Bestimmungen: https://www.credativ.de/datenschutz

#3Andreas 'ads' Scherbaum
adsmail@wars-nicht.de
In reply to: Michael Banck (#2)
Re: Installation instructions update (pg_ctl)

On 30.10.18 09:04, Michael Banck wrote:

Hi,

On Tue, Oct 30, 2018 at 12:08:49AM +0100, Andreas 'ads' Scherbaum wrote:

The installation instructions (short version) are not consistent with the
"initdb" output. The first one still uses "postgres -D", even mentions
"check initdb output", but "initdb" emits "pg_ctl" commands.

The attached patch updates the short install instructions and replaces
"postgres -D" with "pg_ctl" calls.

Check.

diff --git a/doc/src/sgml/standalone-install.xml b/doc/src/sgml/standalone-install.xml
index 62582effed..b5d2835a47 100644
--- a/doc/src/sgml/standalone-install.xml
+++ b/doc/src/sgml/standalone-install.xml
@@ -50,7 +50,7 @@ in the stand-alone version.

That one though seems to be what's ending up in INSTALL, according to
the comment at the beginning of the file.

<screen>root# <userinput>mkdir /usr/local/pgsql/data</userinput>
root# <userinput>chown postgres /usr/local/pgsql/data</userinput>
root# <userinput>su - postgres</userinput>
-postgres$ <userinput>/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data</userinput></screen>
+postgres$ <userinput>/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data</userinput></screen>
</para>

I'm confused here, the paragraph reads "Create a database installation
with the <command>initdb</command>", so I think this hunk is not
correct and should be removed?

That's indeed one replacement too much.

The attached patch is fixing this.

@@ -77,25 +77,21 @@ postgres$ <userinput>/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data</useri
The previous <command>initdb</command> step should have told you how to
start up the database server. Do so now. The command should look
something like:
-<programlisting>/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data</programlisting>
-     This will start the server in the foreground. To put the server
-     in the background use something like:
-<programlisting>nohup /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data \
-    &lt;/dev/null &gt;&gt;server.log 2&gt;&amp;1 &lt;/dev/null &amp;</programlisting>
+<programlisting>/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data start</programlisting>
</para>
<para>
To stop a server running in the background you can type:
-<programlisting>kill `cat /usr/local/pgsql/data/postmaster.pid`</programlisting>
+<programlisting>/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data stop</programlisting>
</para>
</step>
<step>
<para>
Create a database:
-<screen><userinput>createdb testdb</userinput></screen>
+<screen><userinput>/usr/local/pgsql/bin/createdb testdb</userinput></screen>
Then enter:
-<screen><userinput>psql testdb</userinput></screen>
+<screen><userinput>/usr/local/pgsql/bin/psql testdb</userinput></screen>
to connect to that database. At the prompt you can enter SQL
commands and start experimenting.
</para>

Check.

Thank you for the review!

--
Andreas 'ads' Scherbaum
German PostgreSQL User Group
European PostgreSQL User Group - Board of Directors
Volunteer Regional Contact, Germany - PostgreSQL Project

Attachments:

t39587_3
pg_ctl.difftext/x-patch; name=pg_ctl.diffDownload+5-9
#4Andreas 'ads' Scherbaum
adsmail@wars-nicht.de
In reply to: Andreas 'ads' Scherbaum (#3)
Re: Installation instructions update (pg_ctl)

On 30.10.18 14:52, Andreas 'ads' Scherbaum wrote:

On 30.10.18 09:04, Michael Banck wrote:

Hi,

On Tue, Oct 30, 2018 at 12:08:49AM +0100, Andreas 'ads' Scherbaum wrote:

The installation instructions (short version) are not consistent
with the
"initdb" output. The first one still uses "postgres -D", even mentions
"check initdb output", but "initdb" emits "pg_ctl" commands.

The attached patch updates the short install instructions and replaces
"postgres -D" with "pg_ctl" calls.

Check.

diff --git a/doc/src/sgml/standalone-install.xml 
b/doc/src/sgml/standalone-install.xml
index 62582effed..b5d2835a47 100644
--- a/doc/src/sgml/standalone-install.xml
+++ b/doc/src/sgml/standalone-install.xml
@@ -50,7 +50,7 @@ in the stand-alone version.

That one though seems to be what's ending up in INSTALL, according to
the comment at the beginning of the file.

  <screen>root# <userinput>mkdir /usr/local/pgsql/data</userinput>
  root# <userinput>chown postgres /usr/local/pgsql/data</userinput>
  root# <userinput>su - postgres</userinput>
-postgres$ <userinput>/usr/local/pgsql/bin/initdb -D 
/usr/local/pgsql/data</userinput></screen>
+postgres$ <userinput>/usr/local/pgsql/bin/pg_ctl -D 
/usr/local/pgsql/data</userinput></screen>
      </para>

I'm confused here, the paragraph reads "Create a database installation
with the <command>initdb</command>", so I think this hunk is not
correct and should be removed?

That's indeed one replacement too much.

The attached patch is fixing this.

@@ -77,25 +77,21 @@ postgres$ <userinput>/usr/local/pgsql/bin/initdb 
-D /usr/local/pgsql/data</useri
       The previous <command>initdb</command> step should have told 
you how to
       start up the database server. Do so now. The command should look
       something like:
-<programlisting>/usr/local/pgsql/bin/postgres -D 
/usr/local/pgsql/data</programlisting>
-     This will start the server in the foreground. To put the server
-     in the background use something like:
-<programlisting>nohup /usr/local/pgsql/bin/postgres -D 
/usr/local/pgsql/data \
-    &lt;/dev/null &gt;&gt;server.log 2&gt;&amp;1 &lt;/dev/null 
&amp;</programlisting>
+<programlisting>/usr/local/pgsql/bin/pg_ctl -D 
/usr/local/pgsql/data start</programlisting>
      </para>
        <para>
       To stop a server running in the background you can type:
-<programlisting>kill `cat 
/usr/local/pgsql/data/postmaster.pid`</programlisting>
+<programlisting>/usr/local/pgsql/bin/pg_ctl -D 
/usr/local/pgsql/data stop</programlisting>
      </para>
     </step>
       <step>
      <para>
       Create a database:
-<screen><userinput>createdb testdb</userinput></screen>
+<screen><userinput>/usr/local/pgsql/bin/createdb 
testdb</userinput></screen>
       Then enter:
-<screen><userinput>psql testdb</userinput></screen>
+<screen><userinput>/usr/local/pgsql/bin/psql 
testdb</userinput></screen>
       to connect to that database. At the prompt you can enter SQL
       commands and start experimenting.
      </para>

Check.

Thank you for the review!

Submitted this to the Commitfest, and took the liberty to add you as a
reviewer.

Thanks,

--
Andreas 'ads' Scherbaum
German PostgreSQL User Group
European PostgreSQL User Group - Board of Directors
Volunteer Regional Contact, Germany - PostgreSQL Project

#5Ryan Lambert
ryan@rustprooflabs.com
In reply to: Andreas 'ads' Scherbaum (#4)
Re: Installation instructions update (pg_ctl)

I used the updated instructions from pg_ctl.diff to install from source. Worked well for me, new version is more consistent.

#6Michael Banck
michael.banck@credativ.de
In reply to: Andreas 'ads' Scherbaum (#4)
Re: Installation instructions update (pg_ctl)

Hi,

On Sat, Nov 03, 2018 at 09:56:46PM +0100, Andreas 'ads' Scherbaum wrote:

That's indeed one replacement too much.

The attached patch is fixing this.

Thank you for the review!

Submitted this to the Commitfest, and took the liberty to add you as a
reviewer.

Sorry, I didn't look at it during that (November) commitfest cause it
was submitted late, and then forgot about it.

I think the changes are fine and I've marked it Ready for Committer.

Michael

--
Michael Banck
Projektleiter / Senior Berater
Tel.: +49 2166 9901-171
Fax: +49 2166 9901-100
Email: michael.banck@credativ.de

credativ GmbH, HRB Mönchengladbach 12080
USt-ID-Nummer: DE204566209
Trompeterallee 108, 41189 Mönchengladbach
Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer

Unser Umgang mit personenbezogenen Daten unterliegt
folgenden Bestimmungen: https://www.credativ.de/datenschutz

#7Michael Paquier
michael@paquier.xyz
In reply to: Michael Banck (#6)
Re: Installation instructions update (pg_ctl)

On Thu, Jan 31, 2019 at 05:09:09PM +0100, Michael Banck wrote:

Sorry, I didn't look at it during that (November) commitfest cause it
was submitted late, and then forgot about it.

I think the changes are fine and I've marked it Ready for Committer.

Agreed, so committed.
--
Michael