Re: docs are incomplete or wrong... - Mailing list pgsql-docs

From David G. Johnston
Subject Re: docs are incomplete or wrong...
Date
Msg-id CAKFQuwabWB_zRbeEuSXcrou2og-6Z0EB_Y+zFVFxL1WCVha+vQ@mail.gmail.com
Whole thread Raw
In response to docs are incomplete or wrong...  (PG Doc comments form <noreply@postgresql.org>)
List pgsql-docs
On Thursday, December 12, 2024, PG Doc comments form <noreply@postgresql.org> wrote:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/17/tutorial-createdb.html
Description:

Folowing the online docs @
https://www.postgresql.org/docs/17/tutorial-createdb.html
it says: "To create a new database, in this example named mydb, you use the
following command:

$ createdb mydb"
When performing it error comes:
"createdb: error: connection to server on socket
"/var/run/postgresql/.s.PGSQL.5432" failed: FATAL:  role "root" does not
exist"
No matter what explanation there is for it, this is supposed to be official
documentation. It MUST be right.

The documentation is required to make some assumptions/requirements regarding the operating context of the examples.  Namely, you are running commands as the OS user postgres, and that user can peer authenticate (or trust…) into the default location for where you initdb’d and the cluster (discussed earlier in the documentation).  You are running the command as root and thus violating those requirements.

IOW, it is correct but has pre-requisites that you haven’t followed.  There is no good way to make such an example entirely self-contained and pre-requisite free.  But if you’d like to suggest an improvement we are open to making tweaks.

David J.

pgsql-docs by date:

Previous
From: Ian Lawrence Barwick
Date:
Subject: Re: docs are incomplete or wrong...
Next
From: Tom Lane
Date:
Subject: Re: Size limit for NOTIFY payload