Custom table AMs need to include heapam.h because of BulkInsertState

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Custom table AMs need to include heapam.h because of BulkInsertState
Дата
Msg-id 20190601190924.GA1905@paquier.xyz
обсуждение исходный текст
Ответы Re: Custom table AMs need to include heapam.h because ofBulkInsertState
Re: Custom table AMs need to include heapam.h because of BulkInsertState
Список pgsql-hackers
Hi all,

I have been playing lately with the table AM API to do some stuff, and
I got surprised that in the minimum set of headers which needs to be
included for a table AM we have a hard dependency with heapam.h for
BulkInsertState and vacuum.h for VacuumParams.

I am fine to live with the dependency with vacuum.h as it is not that
strange.  However for BulkInsertState we get a hard dependency with a
heap-related area and it seems to me that we had better move that part
out of heapam.c, as we want a clear dependency cut with the heap AM
for any new custom table AM.

I'd like to think that the best way to deal with that and reduce the
confusion would be to move anything related to bulk inserts into their
own header/file, meaning the following set:
- ReleaseBulkInsertStatePin
- GetBulkInsertState
- FreeBulkInsertState
There is the argument that we could also move that part into tableam.h
itself though as some of the rather generic table-related callbacks,
but that seems grotty.  So I think that we could just move that stuff
as backend/access/common/bulkinsert.c.

Thoughts?
--
Michael

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Docs for refresh materialized view concurrently
Следующее
От: Michael Paquier
Дата:
Сообщение: Table AM callbacks referring to heap in declarations (+typos)