On 29.12.2010 13:17, Robert Haas wrote:
> Did you read the whole thread?
Ah, sorry:
> I've had to change some of the heap_open(rv) calls to
> relation_open(rv) to avoid having the former throw the wrong error
> message before the latter kicks in. I think there might be stylistic
> objections to that, but I'm not sure what else to propose. I'm
> actually pretty suspicious that many of the heap_open(rv) calls I
> *didn't* change are either already a little iffy or likely to become
> so once the SQL/MED stuff for foreign tables goes in. They make it
> easy to forget that we've got a whole pile of relkinds and you
> actually need to really think about which ones you can handle.
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.
Yeah, you're right that most of the callers of heap_open actually want
to a tighter check than that.
-- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com