Re: table AM option passing

Antonin Houska <ah@cybertec.at>

From: Antonin Houska <ah@cybertec.at>
To: alvherre@kurilemu.de
Cc: Chao Li <li.evan.chao@gmail.com>, Andres Freund <andres@anarazel.de>, Pg Hackers <pgsql-hackers@lists.postgresql.org>, Zsolt Parragi <zsolt.parragi@percona.com>, Nathan Bossart <nathandbossart@gmail.com>
Date: 2026-04-02T05:39:43Z
Lists: pgsql-hackers
Álvaro Herrera <alvherre@kurilemu.de> wrote:

> On 2026-Apr-01, Antonin Houska wrote:

> I realized that patch 0003 is doing two different things, and they
> should each be their own patch which can be rejected if we don't like
> them; so I split it in two.  One moves the heapam.h-private bit to the
> 32th bit.

I'm sorry I haven't recalled yesterday, but this technique resembles the
DSM keys in parallel.c:


  /*
   * Magic numbers for per-context parallel state sharing.  Higher-level code
   * should use smaller values, leaving these very large ones for use by this
   * module.
   */
  #define PARALLEL_KEY_FIXED		UINT64CONST(0xFFFFFFFFFFFF0001)
  ...


What I found inspiring here is that the "core" uses the high bits while users
of the API use the lower ones. Perhaps it'd be appropriate in v6-0001 to
reserve the high bits for the TABLE_ options and leave the lower ones for the
HEAP_ options. If someone implements a new AM (possibly as an extension), it
should be more comfortable for him.

-- 
Antonin Houska
Web: https://www.cybertec-postgresql.com



Commits

  1. Give an 'options' parameter to tuple_delete/_update

  2. Fix vicinity of tuple_insert to use uint32, not int, for options

  3. Have table_insert and siblings use an unsigned type for options

  4. Remove the following unused type definitions: bool8, bool16, bool32, word8,