[PATCH] Warn users about duplicate configuration parameters
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.
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:t36451psql -h localhost -U postgresBuilt from patchset v1 (message #1), July 28, 2026 at 07:13 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 t36451_1 https://github.com/hackorum-dev/postgres.gitIn a checkout you already have, add the fork once:
git remote add hackorum https://github.com/hackorum-dev/postgres.gitthen, for this patchset and every later one:
git fetch hackorum t36451_1 && git checkout t36451_1Patchset v1 (message #1) is on t36451_1
Hi.
Recently I've discovered that if there are multiple values of the same
parameter in postgresql.conf PostgreSQL will silently use the last one.
It looks like not the best approach to me. For instance, user can find
the first value in the config file and expect that it will be used, etc.
I suggest to warn users about duplicated parameters. Here is a
corresponding patch.
Thoughts?
--
Best regards,
Aleksander Alekseev
On 2017-04-07 18:14:27 +0300, Aleksander Alekseev wrote:
Hi.
Recently I've discovered that if there are multiple values of the same
parameter in postgresql.conf PostgreSQL will silently use the last one.
It looks like not the best approach to me. For instance, user can find
the first value in the config file and expect that it will be used, etc.I suggest to warn users about duplicated parameters. Here is a
corresponding patch.Thoughts?
-1 - I frequently just override earlier parameters by adding an include
at the end of the file. Also, with postgresql.auto.conf it's even more
common to override parameters.
Greetings,
Andres Freund
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Recently I've discovered that if there are multiple values of the same
parameter in postgresql.conf PostgreSQL will silently use the last one.
It looks like not the best approach to me. For instance, user can find
the first value in the config file and expect that it will be used, etc.I suggest to warn users about duplicated parameters. Here is a
corresponding patch.Thoughts?
-1 - I frequently just override earlier parameters by adding an include
at the end of the file. Also, with postgresql.auto.conf it's even more
common to override parameters.
-1 from me too by the same reason Andres said.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Andres, Tatsuo,
Thank you for sharing your thoughts.
-1 - I frequently just override earlier parameters by adding an
include at the end of the file. Also, with postgresql.auto.conf it's
even more common to override parameters.
-1 from me too by the same reason Andres said.
I see no problem here. After all, it's just warnings. We can even add
a GUC that disables them specially for experienced users who knows what
she or he is doing. And/or add special case for postgresql.auto.conf.
--
Best regards,
Aleksander Alekseev
On 2017-04-07 18:29:40 +0300, Aleksander Alekseev wrote:
Andres, Tatsuo,
Thank you for sharing your thoughts.
-1 - I frequently just override earlier parameters by adding an
include at the end of the file. Also, with postgresql.auto.conf it's
even more common to override parameters.-1 from me too by the same reason Andres said.
I see no problem here. After all, it's just warnings. We can even add
a GUC that disables them specially for experienced users who knows what
she or he is doing. And/or add special case for postgresql.auto.conf.
More useless warnings make actual warnings less useful.
Greetings,
Andres Freund
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On 4/7/17 11:22 AM, Tatsuo Ishii wrote:
Recently I've discovered that if there are multiple values of the same
parameter in postgresql.conf PostgreSQL will silently use the last one.
It looks like not the best approach to me. For instance, user can find
the first value in the config file and expect that it will be used, etc.I suggest to warn users about duplicated parameters. Here is a
corresponding patch.Thoughts?
-1 - I frequently just override earlier parameters by adding an include
at the end of the file. Also, with postgresql.auto.conf it's even more
common to override parameters.-1 from me too by the same reason Andres said.
-1 from me for the same reason.
--
-David
david@pgmasters.net
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
2017-04-07 12:14 GMT-03:00 Aleksander Alekseev <a.alekseev@postgrespro.ru>:
Recently I've discovered that if there are multiple values of the same
parameter in postgresql.conf PostgreSQL will silently use the last one.
It looks like not the best approach to me. For instance, user can find
the first value in the config file and expect that it will be used, etc.
Postgres configuration file concept is based on overriding parameter
values. It would be annoying if we emit warning for this feature. Also, it
is easier to know which file/line the parameter value came from. You can
check for duplicates with a small script.
--
Euler Taveira Timbira - http://www.
timbira.com.br/
PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento
<http://www.timbira.com.br>
On Fri, Apr 7, 2017 at 8:29 AM, Aleksander Alekseev <
a.alekseev@postgrespro.ru> wrote:
Andres, Tatsuo,
Thank you for sharing your thoughts.
-1 - I frequently just override earlier parameters by adding an
include at the end of the file. Also, with postgresql.auto.conf it's
even more common to override parameters.-1 from me too by the same reason Andres said.
I see no problem here. After all, it's just warnings. We can even add
a GUC that disables them specially for experienced users who knows what
she or he is doing. And/or add special case for postgresql.auto.conf.
-1 for learning how the configuration system work via warning messages.
We've recently added pg_file_settings to provide a holistic view and the
docs cover the topic quite well.
David J.