Improve DDL related functionality in table AM

From: Daniil Davydov <3danissimo(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Improve DDL related functionality in table AM
Date: 2024-12-04 08:13:14
Message-ID: CAJDiXgiCO7Fc1J9fUsmGipJ7VyJzW9XwXw0wdvAu3PoaViskCA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,
Table AM has a callback for assigning a new file locator to the table
(and, accordingly, creating its own storage). That is, as far as I
understand, the design implies that the creator of the access method
has the right to fully dispose of the table storage. However, for
example, there is an "ALTER COLUMN ... TYPE ..." command, inside which
two storage swaps occur (the source table and the temporary one).
Wouldn't it be better to have a separate callback for such an
operation?
I am writing my own access method, and for each table I store some
information in the local memory of the process. In this case, the
information is "linked" to the oid of the table. At this time, ALTER
creates a temporary table, fills it with data, and then deletes it.
And I have no way of knowing that the storage of this table (which I
should be able to manage myself) now belongs to another table (with
the exception of POST_ALTER object access hook, but it looks more like
a hack).

--
Best regards,
Daniil Davydov

Browse pgsql-hackers by date

  From Date Subject
Next Message Pierre Giraud 2024-12-04 08:53:14 doc: Remove LC_COLLATE and LC_CTYPE from SHOW command
Previous Message jian he 2024-12-04 08:10:20 Re: NOT ENFORCED constraint feature