Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
Ian Barwick <ian.barwick@2ndquadrant.com>
From: Ian Barwick <ian.barwick@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>,
Amit Kapila <amit.kapila16@gmail.com>, Stephen Frost <sfrost@snowman.net>,
Robert Haas <robertmhaas@gmail.com>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2019-08-05T06:42:30Z
Lists: pgsql-hackers
On 8/4/19 4:13 AM, Tom Lane wrote: > Ian Barwick <ian.barwick@2ndquadrant.com> writes: >> On 8/3/19 7:27 AM, Tom Lane wrote: >>> Tomas Vondra <tomas.vondra@2ndquadrant.com> writes: >>>> The main issue however is that no code was written yet. > >>> Seems like it ought to be relatively simple ... but I didn't look. > >> The patch I originally sent does exactly this. > > Ah, you did send a patch, but that tries to maintain the existing behavior > of replacing the last occurrence in-place. I think it's simpler and more > sensible to just make a sweep to delete all matches, and then append the > new setting (if any) at the end, as attached. Yes, that is less convoluted. > A more aggressive patch would try to de-duplicate the entire list, not > just the current target entry ... but I'm not really excited about doing > that in a back-patchable bug fix. I thought about doing that but it's more of a nice-to-have and not essential to fix the issue, as any other duplicate entries will get removed the next time ALTER SYSTEM is run on the entry in question. Maybe as part of a future improvement. > I looked at the TAP test you proposed and couldn't quite convince myself > that it was worth the trouble. A new test within an existing suite > would likely be fine, but a whole new src/test/ subdirectory just for > pg.auto.conf seems a bit much. (Note that the buildfarm and possibly > the MSVC scripts would have to be taught about each such subdirectory.) Didn't know that, but couldn't find anywhere obvious to put the test. > At the same time, we lack any better place to put such a test :-(. > Maybe it's time for a "miscellaneous TAP tests" subdirectory? Sounds reasonable. Regards Ian Barwick -- Ian Barwick https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
Commits
-
Doc: improve documentation about postgresql.auto.conf.
- e3ddb112f245 10.11 landed
- 7f77f2aec3d0 11.6 landed
- 57980bdf62f4 9.4.25 landed
- 45aaaa42fefa 13.0 landed
- 372d6a8918e0 12.0 landed
- 1ab92aaa97ce 9.5.20 landed
- 0969a7aa3240 9.6.16 landed
-
Fix ALTER SYSTEM to cope with duplicate entries in postgresql.auto.conf.
- f1bf619acdff 13.0 landed
- f8c9a08520ee 10.11 landed
- a4b0d955bd23 9.4.25 landed
- 75b2f011f642 12.0 landed
- 4784ad7a370e 9.6.16 landed
- 32d38f54a369 11.6 landed
- 29f9b1819a72 9.5.20 landed