Thread: [BUGS] BUG #14576: JDBC's PreparedStatement.getParameterMetaData fails with'could not determine polymorphic type'

The following bug has been logged on the website:

Bug reference:      14576
Logged by:          Laurence Gonsalves
Email address:      from-postgresql@xenomachina.com
PostgreSQL version: 9.5.6
Operating system:   Ubuntu Linux 16.04
Description:

I am using the JDBC driver "org.postgresql:postgresql:42.0.0.jre7".

I'm creating a PreparedStatement with the following SQL:

    SELECT code, title, did
    FROM films
    WHERE did in (select * from unnest(?));

I can set the parameter and execute the query without problems, but if I
call getParameterMetaData() on the PreparedStatement (before executing
the query) an exception is thrown:

    Exception in thread "main" org.postgresql.util.PSQLException: ERROR:
could not determine polymorphic type because input has type "unknown"
    at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)
    at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836)
    at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
    at
org.postgresql.jdbc3.AbstractJdbc3Statement.getParameterMetaData(AbstractJdbc3Statement.java:414)
    ...

This makes it impossible to (programmatically) determine even the number
of parameters the PreparedStatement accepts.


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs