Feature: Add reloption support for table access method

Поиск
Список
Период
Сортировка
От 吴昊
Тема Feature: Add reloption support for table access method
Дата
Msg-id AMUA1wBBBxfc3tKRLLdU64rb.1.1683276279979.Hmail.wuhao@hashdata.cn
обсуждение исходный текст
Ответы Re: Feature: Add reloption support for table access method  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Hi pg-hackers,

When I wrote an extension to implement a new storage by table access method. I found some issues
that the existing code has strong assumptions for heap tables now. Here are 3 issues that I currently have:

1. Index access method has a callback to handle reloptions, but table access method hasn't. We can't
add storage-specific parameters by `WITH` clause when creating a table.
2. Existing code strongly assumes that the data file of a table structures by a serial physical files named
in a hard coded rule: <relfilenode>[.<segno>]. It may only fit for heap like tables. A new storage may have its
owner structure on how the data files are organized. The problem happens when dropping a table.
3. The existing code also assumes that the data file consists of a series of fix-sized block. It may not
be desired by other storage. Is there any suggestions on this situation?

The rest of this mail is to talk about the first issue. It looks reasonable to add a similar callback in
struct TableAmRoutine, and parse reloptions by the callback. This patch is in the attachment file.

Another thing about reloption is that the current API passes a parameter `validate` to tell the parse
functioin to check and whether to raise an error. It doesn't have enough context when these reloptioins
are used:
1. CREATE TABLE ... WITH(...)
2. ALTER TABLE ... SET ...
3. ALTER TABLE ... RESET ...
The reason why the context matters is that some reloptions are disallowed to change after creating
the table, while some reloptions are allowed.
I wonder if this change makes sense for you.

The attached patch only supports callback for TAM-specific implementation, not include the change
about usage context.

Regards,
Hao Wu



Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Drouvot, Bertrand"
Дата:
Сообщение: Re: Add two missing tests in 035_standby_logical_decoding.pl
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: A bug with ExecCheckPermissions