Re: Centralizing protective copying of utility statements
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Date: 2021-06-17T17:03:29Z
Lists: pgsql-hackers
Attachments
- centralize-utility-stmt-copying-2.patch (text/x-diff) patch
I wrote: > What seems like a much safer answer is to make the API change noisy. > That is, move the responsibility for actually calling copyObject > into ProcessUtility itself, and add a bool parameter saying whether > that needs to be done. That forces all callers to consider the > issue, and gives them the tool they need to make the right thing > happen. Here's a v2 that does it like that. In this formulation, we're basically hoisting the responsibility for doing copyObject up into ProcessUtility from its direct children, which seems like a clearer way of thinking about what has to change. We could avoid the side-effects on users of ProcessUtility_hook by doing the copy step in ProcessUtility itself rather than passing the flag on to standard_ProcessUtility. But that sounded like a bit of a kluge. Also, putting the work in standard_ProcessUtility preserves the option to redistribute it into the individual switch arms, in case anyone does find the extra copying overhead annoying for statement types that don't need it. (I don't plan to do any such thing as part of this bug-fix patch, though.) Barring objections, I'm going to push this into HEAD fairly soon, since beta2 is hard upon us. Still thinking about which way to fix it in the back branches. regards, tom lane
Commits
-
Avoid scribbling on input node tree in CREATE/ALTER DOMAIN.
- f172438ef6ff 10.18 landed
- b2c740c426da 12.8 landed
- 4b8b3562e1e6 11.13 landed
- 1a3d30255a4e 9.6.23 landed
- 102f31a208b8 13.4 landed
-
Centralize the logic for protective copying of utility statements.
- 7c337b6b527b 14.0 landed