]> granicus.if.org Git - postgresql/commit
Prevent parser from believing that views have system columns.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 24 Oct 2012 18:54:17 +0000 (14:54 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 24 Oct 2012 18:54:17 +0000 (14:54 -0400)
commit2383d6d132ea1908af73f1285c27f22bc8b6065f
tree696bd7ebc731b6e815a80e63ef6e7c6b7706c9fa
parent613a9ed76f3a07b18195a33391ca2afa68811368
Prevent parser from believing that views have system columns.

Views should not have any pg_attribute entries for system columns.
However, we forgot to remove such entries when converting a table to a
view.  This could lead to crashes later on, if someone attempted to
reference such a column, as reported by Kohei KaiGai.

This problem is corrected properly in HEAD (by removing the pg_attribute
entries during conversion), but in the back branches we need to defend
against existing mis-converted views.  This fix costs us an extra syscache
lookup per system column reference, which is annoying but probably not
really measurable in the big scheme of things.
src/backend/parser/parse_relation.c
src/test/regress/expected/rules.out
src/test/regress/sql/rules.sql