]> granicus.if.org Git - postgresql/commitdiff
Try to make 'cross-database references are not implemented' errors a
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 13 Feb 2004 01:08:20 +0000 (01:08 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 13 Feb 2004 01:08:20 +0000 (01:08 +0000)
bit more helpful by identifying the specific qualified name being
complained of.

src/backend/catalog/namespace.c
src/backend/parser/parse_expr.c
src/backend/parser/parse_target.c

index 6c243877011e6b1d4ff52cbf227b1c9de505670a..91a604eac7eaa65398c8c9c590cdf60c34c4961b 100644 (file)
@@ -13,7 +13,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/catalog/namespace.c,v 1.62 2004/01/19 19:04:40 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/catalog/namespace.c,v 1.63 2004/02/13 01:08:20 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -165,7 +165,9 @@ RangeVarGetRelid(const RangeVar *relation, bool failOK)
                if (strcmp(relation->catalogname, get_database_name(MyDatabaseId)) != 0)
                        ereport(ERROR,
                                        (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                          errmsg("cross-database references are not implemented")));
+                          errmsg("cross-database references are not implemented: \"%s.%s.%s\"",
+                                         relation->catalogname, relation->schemaname,
+                                         relation->relname)));
        }
 
        if (relation->schemaname)
@@ -218,7 +220,9 @@ RangeVarGetCreationNamespace(const RangeVar *newRelation)
                if (strcmp(newRelation->catalogname, get_database_name(MyDatabaseId)) != 0)
                        ereport(ERROR,
                                        (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                          errmsg("cross-database references are not implemented")));
+                          errmsg("cross-database references are not implemented: \"%s.%s.%s\"",
+                                         newRelation->catalogname, newRelation->schemaname,
+                                         newRelation->relname)));
        }
 
        if (newRelation->istemp)
@@ -1182,7 +1186,8 @@ DeconstructQualifiedName(List *names,
                        if (strcmp(catalogname, get_database_name(MyDatabaseId)) != 0)
                                ereport(ERROR,
                                                (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                               errmsg("cross-database references are not implemented")));
+                               errmsg("cross-database references are not implemented: %s",
+                                          NameListToString(names))));
                        break;
                default:
                        ereport(ERROR,
index d1d5e9cb53093fb852bc59cd08064e42cd1419c1..c23e39a25d0a1d0487ea9f7a55d2d91c8839c3f4 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/parser/parse_expr.c,v 1.164 2003/11/29 19:51:52 pgsql Exp $
+ *       $PostgreSQL: pgsql/src/backend/parser/parse_expr.c,v 1.165 2004/02/13 01:08:20 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1115,7 +1115,8 @@ transformColumnRef(ParseState *pstate, ColumnRef *cref)
                                if (strcmp(name1, get_database_name(MyDatabaseId)) != 0)
                                        ereport(ERROR,
                                                        (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                                                        errmsg("cross-database references are not implemented")));
+                                                        errmsg("cross-database references are not implemented: %s",
+                                                                       NameListToString(cref->fields))));
 
                                /* Whole-row reference? */
                                if (strcmp(name4, "*") == 0)
index ec7f1db0a6f70e4db8f4d6c8e47664748b3c7fa5..6bed23f906467afbd9f3330f63a07ccd41a99280 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.114 2003/11/29 19:51:52 pgsql Exp $
+ *       $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.115 2004/02/13 01:08:20 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -159,7 +159,8 @@ transformTargetList(ParseState *pstate, List *targetlist)
                                                        if (strcmp(name1, get_database_name(MyDatabaseId)) != 0)
                                                                ereport(ERROR,
                                                                                (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                                                                                errmsg("cross-database references are not implemented")));
+                                                                                errmsg("cross-database references are not implemented: %s",
+                                                                                               NameListToString(fields))));
                                                        schemaname = strVal(lsecond(fields));
                                                        relname = strVal(lthird(fields));
                                                        break;