Re: BUG #18000: Access method used by matview can be dropped leaving broken matview

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2023-06-27T23:19:15Z
Lists: pgsql-bugs
On Tue, Jun 27, 2023 at 10:03:48AM -0700, Nathan Bossart wrote:
> I haven't looked at the patch, but assuming it's not calling
> finish_heap_swap(), it might be okay.  But it does seem prudent to check
> that the dependency records are handled correctly.

Double-checking, the patch is able to handle that with an extra
changeDependencyFor() in a code path for relkinds that have no
storage.  What the patch does not do it look at pg_depend to see if
the dependency records are stored correctly, and that's something it
had better do.
--
Michael

Commits

  1. Fix pg_depend entry to AMs after ALTER TABLE .. SET ACCESS METHOD