Re: Fallback table AM for relkinds without storage

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Fallback table AM for relkinds without storage
Date: 2021-02-22 07:37:12
Message-ID: YDNfKJdZAA0hGH6n@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Feb 21, 2021 at 09:43:59AM -0600, Justin Pryzby wrote:
> If you apply this patch, will you want to actually revert those
> earlier changes?

That's not in the plan.

> Also (related), this still crashes if methods are omitted from the initializer,
> like:
>
> // .slot_callbacks = no_storage_slot_callbacks,
>
> I'm not sure if there's any better way to enforce that's updated when callbacks
> are added.
>
> Most of the methods have Assert( != NULL), so maybe this one is missing?
>
> src/backend/access/table/tableamapi.c
> GetTableAmRoutine(Oid amhandler)
> ...
> Assert(routine->slot_callbacks != NULL);

Good point, that looks like an omission. Even if the code tries to
look after the slot type for a view, foreign table or partitioned
table, this cannot be NULL.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2021-02-22 08:03:45 Re: doc review for v14
Previous Message Mats Kindahl 2021-02-22 07:33:21 Table AM and DDLs