Re: DROP OWNED CASCADE vs Temp tables

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Mithun Cy <mithun.cy@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2020-01-14T00:19:38Z
Lists: pgsql-bugs, pgsql-hackers
On Mon, Jan 13, 2020 at 07:45:06PM -0300, Alvaro Herrera wrote:
> This seems fiddly to handle better; maybe you'd have to have a new
> PERFORM_DELETION_* flag that says to ignore "missing" objects; so when
> you go from shdepDropOwned, you pass that flag all the way down to
> doDeletion(), so the objtype-specific function is called with
> "missing_ok", and ignore if the object has already gone away.  That's
> tedious because none of the Remove* functions have the concept of
> missing_ok.

Yes, that would be invasive and I'd rather not backpatch such a change
but I don't see a better or cleaner way to handle that correctly
either than the way you are describing.  Looking at all the
subroutines removing the objects by OID, a patch among those lines is
repetitive, though not complicated to do.
--
Michael

Commits

  1. Heed lock protocol in DROP OWNED BY