Re: 8.0 beta4: Exception when including catalog qualifier in SELECT from - Mailing list pgsql-bugs

From Laferriere, Al
Subject Re: 8.0 beta4: Exception when including catalog qualifier in SELECT from
Date
Msg-id 972DE2275147EA43B00BE0AB9CF3B77F03EF4F@server3.sciforma.com
Whole thread Raw
Responses Re: 8.0 beta4: Exception when including catalog qualifier in
List pgsql-bugs
The following statements work fine in 7.4

=20

                                    Connection conn =3D
DriverManager.getConnection("jdbc:postgresql://localhost:5432/psdb","xxx
","");

                                    Statement stmt =3D
conn.createStatement();

                                    stmt.execute("CREATE TABLE
\"public\".tt (ans bool)");

                                    stmt.close();

=20

                                    stmt =3D conn.createStatement();

                                    ResultSet rs =3D
stmt.executeQuery("SELECT \"psdb \".\"public\".\"tt\".\"ans\" FROM
\"psdb \".\"public\".\"tt\"");

                                    while (rs.next()) {

=20
System.out.println(rs.getBoolean(1));

                                    }

                                    rs.close();

=20

=20

But in 8.0 Beta4 we get the following exception at the SELECT
executeQuery line:

=20

java.sql.SQLException: ERROR: syntax error at end of input

      at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecu
torImpl.java:1187)

      at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImp
l.java:990)

      at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:
138)

      at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Stateme
nt.java:347)

      at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdb
c2Statement.java:279)

      at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2St
atement.java:191)

      at BoolTest.main(BoolTest.java:30)

=20

=20

OS =3D Windows XP Pro

Java version 1.5.0-b64

JDBC driver: pgdev.307.jdbc3.jar

=20

This seems to be related to having the catalog qualifier.  There is no
problem when just the schema is included. i.e.=20

            ResultSet rs =3D stmt.executeQuery("SELECT
\"public\".\"tt\".\"ans\" FROM \"public\".\"tt\"");

works OK.

=20

Also, there is no problem with UPDATE or INSERT statements when the
catalog is included.  Only in the SELECT statement.

=20

I did note that the driver does return false to
connection.getMetaData().supportsCatalogsInDataManipulation(), so, there
is actually no reason to expect that catalog qualifiers would be
supported. However, as noted, it did work OK in 7.4 (even though the
supportsCatalogsInDataManipulation() returned false there also).

=20

Same type of error is returned just running fully qualified SQL
statements in the Query Tool in pgAdmin.

=20

Thanks.

=20

-al laferriere

pgsql-bugs by date:

Previous
From: "Alex Koh"
Date:
Subject: Re: BUG #1302: Vacuumdb and vacuumlo should disable statement_timeout
Next
From: Ralph Heinkel
Date:
Subject: rules ON INSERT