Re: Wrong order of tests in findDependentObjects()
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jim Nasby <Jim.Nasby@BlueTreble.com>
Cc: pgsql-hackers@postgresql.org
Date: 2016-11-28T19:48:10Z
Lists: pgsql-hackers
Attachments
- keep-extensions-when-dropping-temp-objects.patch (text/x-diff) patch
I wrote: > Jim Nasby <Jim.Nasby@BlueTreble.com> writes: >> I can't think of any reason you'd want the current behavior. > But I think fixing it to not recurse to extensions during temp namespace > cleanup might not be very hard. I'll take a look. Here's a draft patch for that. Rather than sticking yet another special assumption into deleteWhatDependsOn, I thought it was time to get rid of that function altogether in favor of selecting its few special behaviors via flag bits for performDeletion. So this adds PERFORM_DELETION_QUIETLY and PERFORM_DELETION_SKIP_ORIGINAL flag bits to do that, plus a PERFORM_DELETION_SKIP_EXTENSIONS bit that solves the problem at hand. Treating this as a performDeletion flag bit also lets us disable extension dropping in autovacuum's forced drop of temp tables, which would otherwise be a nasty hole in the fix. I'm not sure if this is a candidate for back-patching or not. I think what it's fixing is mostly a convenience thing, since extension scripts that explicitly drop any temp objects they've created are not at risk, and that would be good extension authoring practice anyway IMO. If we do back-patch we'd need to figure out whether we want to preserve deleteWhatDependsOn as a stub function in the back branches. (I rather doubt that any third party code is calling it, since it's so special-purpose, but you never know ...) Thoughts? regards, tom lane
Commits
-
Delete deleteWhatDependsOn() in favor of more performDeletion() flag bits.
- b3427dade14c 10.0 landed
-
Fix some issues with temp/transient tables in extension scripts.
- 08dd23cec7d6 9.2.0 cited