Thank you for review on this subject. I think it's extremely important for PostgreSQL to eventually get pluggable storage API.
In general I agree with all your points. But I'd like to make couple of comments.
On Tue, Aug 15, 2017 at 9:53 AM, Andres Freund <andres@anarazel.de> wrote:
- I don't think we should introduce this without a user besides heapam. The likelihood that API will be usable by anything else without a testcase seems fairly remote. I think some src/test/modules type implementation of a per-session, in-memory storage - relatively easy to implement - or such is necessary.
+1 for having a user before committing API. However, I'd like to note that sample storage implementation should do something really different from out current heap. In particular, if per-session, in-memory storage would be just another way to keep heap in local buffers, it wouldn't be OK for me; because such kind of storage could be achieved way more easier without so complex API. But if per-session, in-memory storage would, for instance, utilize different MVCC implementation, that would be very good sample of storage API usage.
- Minor: don't think the _function suffix for Storis necessary, just makes things long, and every member has it. Besides that, it's also easy to misunderstand - for a second I understood scan_getnext_function to be about getting the next function...
_function suffix looks long for me too. But we should look on this question from uniformity point of view. FdwRoutine, TsmRoutine, IndexAmRoutine use _function suffix. This is why I think we should use _function suffix for StorageAmRoutine unless we're going to change that for other *Routines too.
------ Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company