Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:Hmm, I believe the idea of heap_open is to check that the relation is
backed by a heap that you can read with heap_beginscan+heap_next. At the
moment that includes normal tables, sequences and toast tables. Foreign
tables would not fall into that category.
I don't believe that that definition is documented anyplace; if wedecide that's what we want it to mean, some code comments would be inorder.
The existing comments mention that callers must check that the return value is not a view, if they care. So if there is currently a single coherent definition for what heap_open is supposed to do, it's clearly NOT the one Heikki proposes. My guess is that reality is closer to your theory of "what got cut-and-pasted".
...Robert