Re: Add LINE: hint when schemaname.typename is a non-existent schema

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ryan Kelly <rpkelly22(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Add LINE: hint when schemaname.typename is a non-existent schema
Date: 2015-02-03 16:10:26
Message-ID: 4293.1422979826@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ryan Kelly <rpkelly22(at)gmail(dot)com> writes:
> The attached patch adds a LINE: ... hint when schemaname.typename
> results in a schema which does not exist. I came across this when a
> missing comma in a SELECT list resulted in an error without a location
> in a query a few thousand lines long.

I think this is a good problem to attack, but the proposed patch seems
a bit narrow and brute-force. Surely this isn't the only place where
we're missing an errposition pointer on a "no such schema" error?

It's probably not reasonable to add a pstate argument to
LookupExplicitNamespace itself, given that namespace.c isn't part
of the parser. But you could imagine adding an interface function
in the parser that calls LookupExplicitNamespace and then throws a
position-aware error on failure, and then making sure that all schema
lookups in the parser go through that.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-02-03 16:15:15 Re: Release note bloat is getting out of hand
Previous Message Robert Haas 2015-02-03 16:00:43 Re: Getting rid of wal_level=archive and default to hot_standby + wal_senders