Re: Fallback table AM for relkinds without storage

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fallback table AM for relkinds without storage
Date: 2021-02-15 07:21:38
Message-ID: YCohAhyzYb9Wlqyx@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 09, 2021 at 04:27:34PM +0900, Michael Paquier wrote:
> Putting sanity checks within all the table_* functions of tableam.h
> would not be a good idea, as nothing prevents the call of what's
> stored in rel->rd_tableam.

I have been playing with this idea, and finished with the attached,
which is not the sexiest patch around. The table AM used as fallback
for tables without storage is called no_storage (this could be called
virtual_am?). Reverting e786be5 or dd705a0 leads to an error coming
from no_storage instead of a crash.

One thing to note is that this simplifies a bit slot_callbacks as
views, foreign tables and partitioned tables can grab their slot type
directly from this new table AM.
--
Michael

Attachment Content-Type Size
0001-Add-no_storage-fallback-table-AM-for-relations-witho.patch text/x-diff 30.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Nancarrow 2021-02-15 07:39:36 Re: Parallel INSERT (INTO ... SELECT ...)
Previous Message Masahiko Sawada 2021-02-15 07:11:58 Re: a misbehavior of partition row movement (?)