Postgres and --config-file option

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Postgres and --config-file option
Date: 2024-01-13 10:39:50
Message-ID: CAJ7c6TMkuLiLfrA+EFCPYfhXoMKRxxssB5c86+ibxfaz6+=Sdg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

A friend of mine complained about strange behavior of `postgres`. When
executed without any arguments the following error is shown:

```
$ postgres
postgres does not know where to find the server configuration file.
You must specify the --config-file or -D invocation option or set the
PGDATA environment variable.
```

However --config-file is not listed in --help output. Apparently
that's because it's not a regular option but a GUС. It is in fact
supported:

```
$ postgres --config-file=/tmp/fake.txt
postgres: could not access the server configuration file
"/tmp/fake.txt": No such file or directory
```

Additionally --help says:

```
[...]
Please read the documentation for the complete list of run-time
configuration settings and how to set them on the command line or in
the configuration file
```

... which personally I don't find extremely useful to be honest.

OK, let's check section "20.1.4. Parameter Interaction via the Shell"
[1] of the documentation. Currently it doesn't tell anything about the
ability to specify GUCs --like-this, unless I missed something.

Should we remove --config-file from the error message to avoid any
confusion? Should we correct --help output? Should we update the
documentation?

[1]: https://www.postgresql.org/docs/current/config-setting.html#CONFIG-SETTING-SHELL

--
Best regards,
Aleksander Alekseev

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2024-01-13 10:49:08 Re: reorganize "Shared Memory and LWLocks" section of docs
Previous Message Andrei Lepikhov 2024-01-13 09:08:59 Re: POC: GROUP BY optimization