Re: Forgive trailing semicolons inside of config files

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Isaac Morland <isaac(dot)morland(at)gmail(dot)com>
Cc: Greg Sabino Mullane <htamfids(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Forgive trailing semicolons inside of config files
Date: 2023-07-11 15:34:11
Message-ID: 2509700.1689089651@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Isaac Morland <isaac(dot)morland(at)gmail(dot)com> writes:
> On Tue, 11 Jul 2023 at 10:43, Greg Sabino Mullane <htamfids(at)gmail(dot)com>
>> # 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.

> Please, no!

I agree. Allowing this would create huge confusion about whether it's
EOL or semicolon that ends a config file entry. If you can write a
semicolon, then why not spread an entry across lines, or write
multiple entries on one line?

It seems possible that someday we might want to convert over to
semicolon-is-end-of-entry precisely to allow such cases. But
I think that if/when we do that, it should be a flag day where you
*must* change to the new syntax. (We did exactly that in pgbench
scripts some years ago, and people didn't complain too much.)

> Or maybe there could be a "check configuration" subcommand which checks the
> configuration.

We have such a thing, see the pg_file_settings view.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-07-11 15:47:33 Re: Performance degradation on concurrent COPY into a single relation in PG16.
Previous Message Aleksander Alekseev 2023-07-11 15:11:31 Re: Latches vs lwlock contention