Forgive trailing semicolons inside of config files

From: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Forgive trailing semicolons inside of config files
Date: 2023-07-11 14:42:19
Message-ID: CAKAnmm+o3QA7oXmGbBUXBeNL6ZSr9Nw4+VNW8H2FUDwGXSF-wQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

This has been a long-standing annoyance of mine. Who hasn't done something
like this?:

psql> SET random_page_cost = 2.5;
(do some stuff, realize that rpc was too high)

Let's put that inside of postgresql.conf:

#------------------------------------------------------------------------------
# CUSTOMIZED OPTIONS
#------------------------------------------------------------------------------

# Add settings for extensions here

random_page_cost = 2.5;

Boom! Server will not start. Surely, we can be a little more liberal in
what we accept? Attached patch allows a single trailing semicolon to be
silently discarded. As this parsing happens before the logging collector
starts up, the error about the semicolon is often buried somewhere in a
separate logfile or journald - so let's just allow postgres to start up
since there is no ambiguity about what random_page_cost (or any other GUC)
is meant to be set to.

I also considered doing an additional ereport(LOG) when we find one, but
seemed better on reflection to simply ignore it.

Cheers,
Greg

Attachment Content-Type Size
postgresql.conf_allow_trailing_semicolon.v1.patch application/octet-stream 965 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tristan Partin 2023-07-11 14:46:43 Re: Use COPY for populating all pgbench tables
Previous Message Alvaro Herrera 2023-07-11 14:17:20 Re: cataloguing NOT NULL constraints