Re: Add LINE: hint when schemaname.typename is a non-existent schema - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Add LINE: hint when schemaname.typename is a non-existent schema
Date
Msg-id 4293.1422979826@sss.pgh.pa.us
Whole thread Raw
In response to Add LINE: hint when schemaname.typename is a non-existent schema  (Ryan Kelly <rpkelly22@gmail.com>)
Responses Re: Add LINE: hint when schemaname.typename is a non-existent schema  (Ryan Kelly <rpkelly22@gmail.com>)
List pgsql-hackers
Ryan Kelly <rpkelly22@gmail.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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Getting rid of wal_level=archive and default to hot_standby + wal_senders
Next
From: Tom Lane
Date:
Subject: Re: Release note bloat is getting out of hand