Re: Allow table AMs to define their own reloptions

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Ajit Awekar <ajitpostgres(at)gmail(dot)com>
Cc: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Junwang Zhao <zhjwpku(at)gmail(dot)com>, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>, Julien Tachoires <julien(at)tachoires(dot)me>
Subject: Re: Allow table AMs to define their own reloptions
Date: 2026-09-30 13:45:28
Message-ID: a15db9d5-3ebb-4e6a-80e9-c900aad638a0@dunslane.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


[please don't top-post]

On 2026-09-30 We 4:35 AM, Ajit Awekar wrote:
> I tested v8 and found below two issues.
>
> 1. SET before RESET.  Final state (heap, fillfactor=50) is valid. but
> resulting in an error ERROR:  unrecognized parameter "option_int".
> However Reset before set works as expected.
>
>

Yes, that's a bug.  v9 skips  the per-subcommand check when SET ACCESS
METHOD is queued in the same statement. The deferred check still rejects
unknown names and out-of-range values, and there are tests for both
orders as well as those cases.

>
> 2.The current dummy_table_am always embeds StdRdOptions, so it cannot
>   catch this. For this issue  make dummy_table_am's struct start with
>   {int32 vl_len_; int pad1; int pad2; int option_int;}, keep only the
>   option_int registration, dt_relopt_tab[1], and set
>   has_std_options_prefix = false.
>

The bug is fixed in v9. I've added a second dummy AM to the test that
doesn't embed StdRdoptions, so we could catch issues like this in future.

cheers

andrew

--
Andrew Dunstan
EDB:https://www.enterprisedb.com

Attachment Content-Type Size
v9-0001-Add-amoptions-callback-to-table-access-methods.patch text/x-patch 77.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Egor Ivkov 2026-09-30 14:02:34 Re: [PATCH] intXshr, intXshl: return error on shift count out of range
Previous Message Tom Lane 2026-09-30 13:40:21 Re: BUG #19686: Rolling back SET TABLESPACE