Thread: Re: RFC: Query Planner making a distinction between Cross
On Thu, 12 Feb 2004, Stef wrote: > > Ummmm. Postgresql doesn't natively support cross database queries... > > > > I know, but it does schema's, and currently, the same > notation is used to specify schema's as 'cross database'. > > So the planner often reports 'cross-database not allowed' > in areas where it should at least report 'cross-schema > support is unavailable for this' > > case in point, the example trigger. i would have expected > deliberate schemaname.table during an insert to work, but > instead the parser complains about cross-database. I would think just changing the error message to "no schema by the name of suchandsuch found" would make it pretty clear.
Re: RFC: Query Planner making a distinction between Cross Database and Cross Schema ?
From
Stef
Date:
> > case in point, the example trigger. i would have expected > > deliberate schemaname.table during an insert to work, but > > instead the parser complains about cross-database. > > I would think just changing the error message to "no schema by the name of > suchandsuch found" would make it pretty clear. > indeed, the only problem being, that this is a -deliberately- called schema and it does exist jst that its not in the search_path. surely the pl/pglsql or parser should be able to search the schemanames if i give it a -deliberate- name and if it isnt there say 'not found' ? so, either thats an error (improper parsing/expr forming) in the pl/pgsql trigger code, or, well, i dont know. thoughts ? comments ? barking mad ? Stef
On Thu, 12 Feb 2004, Stef wrote: > > > case in point, the example trigger. i would have expected > > > deliberate schemaname.table during an insert to work, but > > > instead the parser complains about cross-database. > > > > I would think just changing the error message to "no schema by the name of > > suchandsuch found" would make it pretty clear. > > > > indeed, the only problem being, that this is a > -deliberately- called schema and it does exist > jst that its not in the search_path. surely the > pl/pglsql or parser should be able to search the > schemanames if i give it a -deliberate- name and > if it isnt there say 'not found' ? > > so, either thats an error (improper parsing/expr > forming) in the pl/pgsql trigger code, or, well, > i dont know. > > thoughts ? comments ? barking mad ? Hmmm. I would think the first step would be to simply change the cross-db queries aren't supported to one of "schema either does not exist or is not in the search path".
"scott.marlowe" <scott.marlowe@ihs.com> writes: > Hmmm. I would think the first step would be to simply change the cross-db > queries aren't supported to one of "schema either does not exist or is not > in the search path". AFAICT the issue is that Stef thought it was complaining about a different name than it actually was complaining about. I've added code to CVS tip so that these messages will show the qualified name in question. The given example will now produce ERROR: cross-database references are not implemented: history.test_hist.nextval CONTEXT: PL/pgSQL function "test_autohist" line 2 at SQL statement which perhaps will be a bit more illuminating. regards, tom lane