Thread

Commits

  1. Add test for postgresql.conf.sample line syntax

  2. Comment out autovacuum_worker_slots in postgresql.conf.sample.

  1. Uncommented GUC in postgresql.conf.sample

    Daniel Gustafsson <daniel@yesql.se> — 2025-11-14T14:06:44Z

    When looking at the nearby suggestion to add deprecation comment for md5 in the
    .conf.sample, I happened to notice that autovacuum_worker_slots isn't commented
    out it the sample file.
    
    AFAIK all GUCs in the sample file should be set to their defaults and left
    commented out.  The attached does that for autovacuum_worker_slots and adds a
    trivial test to test_misc to catch it (and modifies the existing test which
    would've caught it). Or is there a case for leaving uncommented?
    
    --
    Daniel Gustafsson
    
    
  2. Re: Uncommented GUC in postgresql.conf.sample

    Tom Lane <tgl@sss.pgh.pa.us> — 2025-11-14T14:44:42Z

    Daniel Gustafsson <daniel@yesql.se> writes:
    > When looking at the nearby suggestion to add deprecation comment for md5 in the
    > .conf.sample, I happened to notice that autovacuum_worker_slots isn't commented
    > out it the sample file.
    
    > AFAIK all GUCs in the sample file should be set to their defaults and left
    > commented out.
    
    Yes, that is surely a bug.  It should be fixed and back-patched.
    
    			regards, tom lane
    
    
    
    
  3. Re: Uncommented GUC in postgresql.conf.sample

    Bruce Momjian <bruce@momjian.us> — 2025-11-14T14:51:03Z

    On Fri, Nov 14, 2025 at 09:44:42AM -0500, Tom Lane wrote:
    > Daniel Gustafsson <daniel@yesql.se> writes:
    > > When looking at the nearby suggestion to add deprecation comment for md5 in the
    > > .conf.sample, I happened to notice that autovacuum_worker_slots isn't commented
    > > out it the sample file.
    > 
    > > AFAIK all GUCs in the sample file should be set to their defaults and left
    > > commented out.
    > 
    > Yes, that is surely a bug.  It should be fixed and back-patched.
    
    Yes, but again, be aware that only new initdb's will see this change. 
    People doing a diff against an old postgresql.conf file and a new
    initdb's postgresql.conf.sample in the same major release might see this
    change and think they did it.
    
    -- 
      Bruce Momjian  <bruce@momjian.us>        https://momjian.us
      EDB                                      https://enterprisedb.com
    
      Do not let urgent matters crowd out time for investment in the future.
    
    
    
    
  4. Re: Uncommented GUC in postgresql.conf.sample

    Nathan Bossart <nathandbossart@gmail.com> — 2025-11-14T14:57:46Z

    On Fri, Nov 14, 2025 at 09:44:42AM -0500, Tom Lane wrote:
    > Daniel Gustafsson <daniel@yesql.se> writes:
    >> When looking at the nearby suggestion to add deprecation comment for md5 in the
    >> .conf.sample, I happened to notice that autovacuum_worker_slots isn't commented
    >> out it the sample file.
    > 
    >> AFAIK all GUCs in the sample file should be set to their defaults and left
    >> commented out.
    > 
    > Yes, that is surely a bug.  It should be fixed and back-patched.
    
    That's my bad.  +1 for fixing and back-patching.
    
    -- 
    nathan
    
    
    
    
  5. Re: Uncommented GUC in postgresql.conf.sample

    Andrew Dunstan <andrew@dunslane.net> — 2025-11-14T15:20:41Z

    On 2025-11-14 Fr 9:06 AM, Daniel Gustafsson wrote:
    > When looking at the nearby suggestion to add deprecation comment for md5 in the
    > .conf.sample, I happened to notice that autovacuum_worker_slots isn't commented
    > out it the sample file.
    >
    > AFAIK all GUCs in the sample file should be set to their defaults and left
    > commented out.  The attached does that for autovacuum_worker_slots and adds a
    > trivial test to test_misc to catch it (and modifies the existing test which
    > would've caught it). Or is there a case for leaving uncommented?
    
    
    I don't think so.
    
    
    +    # Make sure each line starts with either a # or whitespace
    +    ok(0, 'missing # in postgresql.conf.sample') if ($line =~ m/^[^#\s]/);
    
    
    This would probably be better written something like:
    
    # non-blank lines must start with a # as the first non-blank character
    unlike($line, qr/^\s*[^#\s]/, 'missing # in postgresql.conf.sample');
    
    
    This will catch more error cases (e.g. a line that starts with spaces 
    and then has a non-#). Also, "ok(0,...)" is a pattern you pretty much 
    never want. My formulation will give better diagnostics if the test fails.
    
    OTOH, if you want to skip a lot of ok's in the regress_log file, you can 
    do something like:
    
    
    fail("$line missing initial # in postgresql.conf.sample") if $line =~ 
    /^\s*[^#\s]/;
    
    
    
    cheers
    
    
    andrew
    
    
    --
    Andrew Dunstan
    EDB:https://www.enterprisedb.com
    
  6. Re: Uncommented GUC in postgresql.conf.sample

    Álvaro Herrera <alvherre@kurilemu.de> — 2025-11-14T15:30:33Z

    On 2025-Nov-14, Andrew Dunstan wrote:
    
    > OTOH, if you want to skip a lot of ok's in the regress_log file, you can do
    > something like:
    > 
    > fail("$line missing initial # in postgresql.conf.sample") if $line =~
    > /^\s*[^#\s]/;
    
    Yeah, I'm pretty confident we don't want one "ok" per correct line in
    the sample file :-)
    
    -- 
    Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
    "I'm always right, but sometimes I'm more right than other times."
                                                      (Linus Torvalds)
    https://lore.kernel.org/git/Pine.LNX.4.58.0504150753440.7211@ppc970.osdl.org/
    
    
    
    
  7. Re: Uncommented GUC in postgresql.conf.sample

    Nathan Bossart <nathandbossart@gmail.com> — 2025-11-14T19:01:08Z

    On Fri, Nov 14, 2025 at 08:57:46AM -0600, Nathan Bossart wrote:
    > That's my bad.  +1 for fixing and back-patching.
    
    Since it's my bug, I'll go ahead and apply the fix.  I'll leave the new
    test to you, though (unless you'd rather me take that, too).
    
    -- 
    nathan
    
    
    
    
  8. Re: Uncommented GUC in postgresql.conf.sample

    Nathan Bossart <nathandbossart@gmail.com> — 2025-11-14T19:46:48Z

    On Fri, Nov 14, 2025 at 01:01:08PM -0600, Nathan Bossart wrote:
    > Since it's my bug, I'll go ahead and apply the fix.
    
    Committed.
    
    -- 
    nathan
    
    
    
    
  9. Re: Uncommented GUC in postgresql.conf.sample

    Daniel Gustafsson <daniel@yesql.se> — 2025-11-14T22:57:53Z

    > On 14 Nov 2025, at 16:20, Andrew Dunstan <andrew@dunslane.net> wrote:
    
    > OTOH, if you want to skip a lot of ok's in the regress_log file, you can do something like:
    > 
    > fail("$line missing initial # in postgresql.conf.sample") if $line =~ /^\s*[^#\s]/;
    
    Went ahead with a change along this line to keep the test log noise down.
    Thanks for review!
    
    --
    Daniel Gustafsson