Forgive trailing semicolons inside of config files - Mailing list pgsql-hackers

From Greg Sabino Mullane
Subject Forgive trailing semicolons inside of config files
Date
Msg-id CAKAnmm+o3QA7oXmGbBUXBeNL6ZSr9Nw4+VNW8H2FUDwGXSF-wQ@mail.gmail.com
Whole thread Raw
Responses Re: Forgive trailing semicolons inside of config files
List 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

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: cataloguing NOT NULL constraints
Next
From: "Tristan Partin"
Date:
Subject: Re: Use COPY for populating all pgbench tables