pgsql: Improve plpgsql's handling of record field references by forcing

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve plpgsql's handling of record field references by forcing
Date: 2010-01-10 17:15:18
Message-ID: 20100110171518.A32B17541B9@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Improve plpgsql's handling of record field references by forcing all potential
field references in SQL expressions to have RECFIELD datum-array entries at
parse time. If it turns out that the reference is actually to a SQL column,
the RECFIELD entry is useless, but it costs little. This allows us to get rid
of the previous use of FieldSelect applied to a whole-row Param for the record
variable; which was not only slower than a direct RECFIELD reference, but
failed for references to system columns of a trigger's NEW or OLD record.
Per report and fix suggestion from Dean Rasheed.

Modified Files:
--------------
pgsql/src/pl/plpgsql/src:
gram.y (r1.137 -> r1.138)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/gram.y?r1=1.137&r2=1.138)
pl_comp.c (r1.147 -> r1.148)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/pl_comp.c?r1=1.147&r2=1.148)
pl_scanner.c (r1.3 -> r1.4)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/pl_scanner.c?r1=1.3&r2=1.4)
plpgsql.h (r1.127 -> r1.128)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/plpgsql.h?r1=1.127&r2=1.128)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2010-01-10 17:56:50 pgsql: Improve plpgsql parsing to report "foo is not a known variable",
Previous Message Simon Riggs 2010-01-10 16:27:27 pgsql: Docs for behaviour change of drop database during Hot Standby