When executing a query with a WHERE clause against a foreign table created via greenplum_fdw, the query fails with the following error in JDBC clients (e.g., DBeaver) or Python applications using psycopg:
SQL Error [34000]: ERROR: portal "" does not exist
However, directly running the query via psql to the database works fine.
greenplum_fdw com.pivotal.jdbc.GreenplumDriver)org.postgresql.Driver)psycopg (v3) client libraryThis issue stems from a known issue in the Greenplum server's Extended Query Protocol handling when dispatching queries involving greenplum_fdw.
Upgrade to Greenplum 7.8.2 or higher.
Modify your JDBC connection string or driver properties to enforce the Simple Query Protocol instead of the Extended Query Protocol.
preferQueryMode = simple.simple mode means the driver will no longer use PreparedStatement optimization on the server side. SQL statements are sent as raw text strings.autocommit=false`)Disable the driver's automatic transaction commitment to artificially extend the lifecycle of the unnamed portal.
Auto-Commit to Manual Commit.connection.setAutoCommit(false); in your application code.COMMIT, you can lock out other users and block production workloads.COMMIT; or ROLLBACK; statements at the end of every business logic unit.