I suppose as we get more and more external table AMs and functionality
we're going to want more and more booleans to say that an AM supports
this or that.  Why not do it just once and invent and interface that
says

uint32  (*relation_supports_feature) (uint32)

so that the code can pass a bunch of TABLEAM_SUPPORTS_FOOBAR flags, and
the routine can fill in the return word with 1 for the features it
supports and 0 for the ones it doesn't?  Then the calling code can ask
for just one or more than one, without spending time on determining
whether it supports bits it wasn't asked about, in case some of them are
expensive to determine.

Maybe add more arguments to the callback in case we deem they necessary,
say the Relation itself or whatever.

This would save us in the future having to add more and more callbacks
to add for specific individual bits.  tableam.h just defines 
TABLEAM_SUPPORTS_LOGICAL_DECODING and so forth, heapam knows to set that
to 1.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
"Siempre hay que alimentar a los dioses, aunque la tierra esté seca" (Orual)


Reply via email to