[Util] Warn and Remove Invalid GUCs

From: Shaik Mohammad Mujeeb <mujeeb(dot)sk(at)zohocorp(dot)com>
To: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Cc: "mujeebskdev" <mujeeb(dot)sk(dot)dev(at)gmail(dot)com>
Subject: [Util] Warn and Remove Invalid GUCs
Date: 2025-05-21 17:51:36
Message-ID: 196f3f8e12f.87666a6c16169.9160742057750715009@zohocorp.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Hackers,

Currently, if there's a typo in an extension name while adding a GUC to postgresql.conf, PostgreSQL server starts up silently without any warning. This can be misleading, as one might assume the configuration has been correctly applied, when in fact the value hasn’t been set due to the typo.

To improve this experience, I’m proposing a patch that issues a warning for such invalid GUC entries. This can serve as a helpful acknowledgment, especially in cases where the mistake is unintentional (e.g., a simple typo).

For example, if I mistakenly add pg_stut_statements.max = 15000 (observe the typo in the extension name) to postgresql.conf and restart PostgreSQL, the server currently starts without indicating any issue. However, with this patch, the startup output will include a warning like:

WARNING:  invalid configuration parameter name "pg_stut_statements.max", removing it

2025-05-21 17:10:45 GMT::@:[44158]:DETAIL:  "pg_stut_statements.max" doesn't has a reserved prefix.

I believe providing such feedback during startup can be quite helpful for users, especially to catch and correct typos early.

Please find the attached patch for your consideration.

Thanks & Regards,

Shaik Mohammad Mujeeb

Member Technical Staff

Zoho Corp

Attachment Content-Type Size
warn_and_remove_invalid_prefix_gucs.patch application/octet-stream 4.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2025-05-21 18:06:17 Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part
Previous Message Robert Haas 2025-05-21 17:47:17 Re: Avoid orphaned objects dependencies, take 3