Skip site navigation (1) Skip section navigation (2)

pgsql: Improve plpgsql's error reporting for no-such-column cases.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve plpgsql's error reporting for no-such-column cases.
Date: 2010-11-18 22:20:50
Message-ID: E1PJCqY-000336-FE@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Improve plpgsql's error reporting for no-such-column cases.

Given a column reference foo.bar, where there is a composite plpgsql
variable foo but it doesn't contain a column bar, the pre-9.0 coding would
immediately throw a "record foo has no field bar" error.  In 9.0 the parser
hook instead falls through to let the core parser see if it can resolve the
reference.  If not, you get a complaint about "missing FROM-clause entry
for table foo", which while in some sense correct isn't terribly helpful.
Complicate things a bit so that we can throw the old error message if
neither the core parser nor the hook are able to resolve the column
reference, while not changing the behavior in any other case.
Per bug #5757 from Andrey Galkin.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=fe24d781612700646bfb3e08925e34c43926f9df

Modified Files
--------------
src/pl/plpgsql/src/pl_comp.c |   43 +++++++++++++++++++++++++++++++++++------
1 files changed, 36 insertions(+), 7 deletions(-)

pgsql-committers by date

Next:From: User BloodnokDate: 2010-11-19 18:08:17
Subject: veil - veil: Updates for version 9.1.12 release, to work with Postgres
Previous:From: Alvaro HerreraDate: 2010-11-18 20:07:22
Subject: pgsql: Add pg_describe_object function

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group