WIP: Rework access method interface - Mailing list pgsql-hackers

From Alexander Korotkov
Subject WIP: Rework access method interface
Date
Msg-id CAPpHfdtLiSXmXk2b4tW+4+No_1-T0raO5fOYszhO6+Sn2Om+xw@mail.gmail.com
Whole thread Raw
Responses Re: WIP: Rework access method interface  (Petr Jelinek <petr@2ndquadrant.com>)
List pgsql-hackers
Hacker,

some time before I proposed patches implementing CREATE ACCESS METHOD.
As I get from comments to my patches and also from Tom's comment about AM interface in tablesampling thread – AM interface needs reworking. And AFAICS AM interface rework is essential to have CREATE ACCESS METHOD command.

This is why I'd like to show a WIP patch implementing AM interface rework. Patch is quite dirty yet, but I think it illustrated the idea quite clear. AM now have single parameter – handler function. This handler returns pointer to AmRoutine which have the same data as pg_am had before. Thus, API is organized very like FDW.

However, this patch appears to take more work than I expected. It have to do many changes spread among many files. Also, it appears not so easy to hide amsupport into AmRoutine, because it's needed for relcache. As a temporary solution it's duplicated in RelationData.

What do you think about this approach of AM interface rework?

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Precedence of standard comparison operators
Next
From: Noah Misch
Date:
Subject: Re: Precedence of standard comparison operators