Re: 8.0 beta4: Exception when including catalog qualifier in SELECT from

From: "Laferriere, Al" <ALaferriere(at)Sciforma(dot)com>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: 8.0 beta4: Exception when including catalog qualifier in SELECT from
Date: 2004-11-02 07:09:15
Message-ID: 972DE2275147EA43B00BE0AB9CF3B77F03EF4F@server3.sciforma.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following statements work fine in 7.4

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

Statement stmt =
conn.createStatement();

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

stmt.close();

stmt = conn.createStatement();

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

while (rs.next()) {


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

}

rs.close();

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

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)

OS = Windows XP Pro

Java version 1.5.0-b64

JDBC driver: pgdev.307.jdbc3.jar

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

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

works OK.

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

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).

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

Thanks.

-al laferriere

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Eisentraut 2004-11-02 08:38:07 Re: psql: set \encoding according to the current locale
Previous Message kael 2004-11-02 06:47:36 Possible bug: pg_hba.conf file