Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 526029FC2BC for ; Fri, 19 Oct 2007 15:15:22 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 67864-08 for ; Fri, 19 Oct 2007 15:15:20 -0300 (ADT) Received: from pgfoundry.org (pgfoundry.org [200.46.204.130]) by postgresql.org (Postfix) with ESMTP id EC17A9FC11A for ; Fri, 19 Oct 2007 15:15:21 -0300 (ADT) Received: from localhost (unknown [200.46.204.183]) by pgfoundry.org (Postfix) with ESMTP id D96A62170A3; Fri, 19 Oct 2007 18:15:21 +0000 (UTC) Received: from pgfoundry.org ([200.46.204.130]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 27177-10; Fri, 19 Oct 2007 15:15:21 -0300 (ADT) Received: by pgfoundry.org (Postfix, from userid 80) id 375B32170A2; Fri, 19 Oct 2007 18:15:21 +0000 (UTC) To: noreply@pgfoundry.org From: Subject: [ psqlodbc-Bugs-1009575 ] MS QUERY fails for multi table query Content-type: text/plain; charset=UTF-8 Message-Id: <20071019181521.375B32170A2@pgfoundry.org> Date: Fri, 19 Oct 2007 18:15:21 +0000 (UTC) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/24 X-Sequence-Number: 9208 Bugs item #1009575, was opened at 2007-10-19 13:15 You can respond by visiting: http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1009575&group_id=1000125 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jay Lundschen (datapoint) Assigned to: Nobody (None) Summary: MS QUERY fails for multi table query Initial Comment: MS QUERY (MSQRY32.exe) fails "ERROR: cross-database references are not implemented:"databasename.public.table"; Error while executing the query" when using psqlODBC 8.02.05, 8.02.04, 8.02.03. It works with 8.02.02. I am using the ANSI driver. When looking at the source I noticed the following: In info.c is case SQL_DATABASE_NAME: /* Support for old ODBC 1.0 Apps */ /* * Returning the database name causes problems in MS Query. It * generates query like: "SELECT DISTINCT a FROM byronnbad3 * bad3" * * p = CC_get_database(conn); */ p = CurrCatString(conn); break; And in connection.c in version 8.02.02 is const char *CurrCat(const ConnectionClass *conn) { /* if (conn->schema_support) return conn->connInfo.database; else */ return NULL; } const char *CurrCatString(const ConnectionClass *conn) { const char *cat = CurrCat(conn); if (!cat) cat = NULL_STRING; return cat; } And in connection.c in version 8.02.03 is const char *CurrCat(const ConnectionClass *conn) { if (conn->schema_support) return conn->connInfo.database; else return NULL; } const char *CurrCatString(const ConnectionClass *conn) { const char *cat = CurrCat(conn); if (!cat) cat = NULL_STRING; return cat; } The change now allows the database name to be returned in version 08.02.03 and later versions if conn->schema_support is true. Please let me know if you need more information. ---------------------------------------------------------------------- You can respond by visiting: http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1009575&group_id=1000125