-
由 Heikki Linnakangas 提交于
The code in rewriteDefine.c didn't know about AO tables, and tried to use heap_beginscan() on an AO table. It resulted in an ERROR, because even for an empty table, RelationGetNumberOfBlocks() returned 1, but we tried to scan it like a heap table, heap_getnext() couldn't find the block. To fix, add an explicit check that you can only turn heap tables into views this way. This also forbids turning an external table into a view. (We could possible relax that limitation, but it's a pointless feature anyway we only support for backwards-compatibility reasons in PostgreSQL.) Also add test case for this.
3131d56a