pgsql: Prevent parser from believing that views have system columns.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Prevent parser from believing that views have system columns.
Date: 2012-10-24 18:54:50
Message-ID: E1TR66M-0007H2-Bm@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/9619fdca106149d9e7bae5db3977435f8ce5f0c2

Modified Files
--------------
src/backend/parser/parse_relation.c | 11 +++++++++--
src/test/regress/expected/rules.out | 22 ++++++++++++++++++++++
src/test/regress/sql/rules.sql | 15 +++++++++++++++
3 files changed, 46 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2012-10-24 20:26:31 pgsql: Tweak genericcostestimate's fudge factor for index size.
Previous Message Tom Lane 2012-10-24 17:39:50 pgsql: When converting a table to a view, remove its system columns.