Minor rework of ALTER TABLE SET RelOptions code

From: Nikolay Shaplov <dhyan(at)nataraj(dot)su>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Minor rework of ALTER TABLE SET RelOptions code
Date: 2025-03-07 17:02:08
Message-ID: 1913854.tdWV9SEqCh@thinkpad-pgpro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

While working with my New Options Engine patch
https://commitfest.postgresql.org/patch/4688/
I found out that I can detach a small portion of it as a separate
patch.
It has own value, even if big patch is never committed, and it would make
smoother further committing of big patch if we ever get to it.

Patch description is following:

1. `isnull` variable is actually needed in a very narrow scope, so
it is better to keep it in that scope, not keeping it in mind in while
dealing with the rest of the code.

2. Toast table RelOptions are never altered directly with ALTER command.
One should do ATLER to a heap relation and use toast. reloption namespace
to address toast's reloption. If you get `ATExecSetRelOptions` called with
`RELKIND_TOASTVALUE` relation in the args, something is really wrong. We
should throw asserts, errors and whistle as loud as we can.

--
Nikolay Shaplov aka Nataraj
Fuzzing Engineer at Postgres Professional
Matrix IM: @dhyan:nataraj.su

Attachment Content-Type Size
v-1-0001-Minor-rework-of-ALTER-TABLE-SET-RelOptions-code.patch text/x-patch 3.4 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2025-03-07 17:03:04 Re: Refactoring postmaster's code to cleanup after child exit
Previous Message Jeff Davis 2025-03-07 16:53:29 Re: Statistics Import and Export