Metabase Transaction Error // All Download options (CSV/XLSX/JSON) fail with "FATAL: transaction blocks not allowed in statement pooling mode

Body: Hi everyone,

I’m facing a persistent error in Metabase v0.58.5]) where all download/export options (CSV, XLSX, and JSON) fail immediately, even though the query results display perfectly in the dashboard and question editor.

The Error: FATAL: transaction blocks not allowed in statement pooling mode

The Situation:

  • Database: PostgreSQL.

  • Infrastructure: The database is managed by an external vendor. I have no access to the server configuration or PgBouncer settings.

  • Observation: The error occurs only when triggering a download. It appears Metabase/the JDBC driver is attempting to open a transaction block for streaming results, which is prohibited by the provider's statement pooling mode.

Tried & Failed Workarounds: I have already tried to resolve this using additional JDBC connection string options, but none of the following worked:

  • prepareThreshold=0

  • reWriteBatchedInserts=true

  • preparedStatementCacheQueries=0

It seems the issue is not related to prepared statements, but specifically to the fact that Metabase requires an open transaction for cursor-based streaming during exports.

Constraints: Since I cannot change the database-side pooling mode (it's a managed service by a third party), I am looking for a way to make Metabase compatible with this environment.

Questions:

  1. Is there a way to force Metabase to execute exports without wrapping them in a transaction block (e.g., by disabling cursor-based streaming)?

  2. Is there any other JDBC parameter that could potentially bypass the transaction requirement for reads?

Has anyone dealt with a similar "locked-down" DB environment and found a way to enable exports?

Thanks in advance!

{
"browser-info": {
"language": "de-DE",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36",
"vendor": "Google Inc."
},
"metabase-info": {
"databases": [
"postgres",
"mysql",
"sqlserver"
],
"run-mode": "prod",
"plan-alias": "",
"version": {
"date": "2026-02-04",
"tag": "v0.58.5",
"hash": "109161b"
},
"settings": {
"report-timezone": "Europe/Berlin"
},
"hosting-env": "unknown",
"application-database": "mysql",
"application-database-details": {
"database": {
"name": "MariaDB",
"version": "11.1.2-MariaDB-1:11.1.2+maria~ubu2204-log"
},
"jdbc-driver": {
"name": "MariaDB Connector/J",
"version": "2.7.10"
}
}
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "21.0.9+10-LTS",
"java.vendor": "Eclipse Adoptium",
"java.vendor.url": "https://adoptium.net/",
"java.version": "21.0.9",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "21.0.9+10-LTS",
"os.name": "Linux",
"os.version": "6.12.57+deb13-amd64",
"user.language": "en",
"user.timezone": "Europe/Berlin"
}
}

Are you using a pgbouncer?

Hi there,

Is this Supabase or some sort of cloud database? We recommend connecting directly (IPv4), since the external pooler can conflict with the internal pooling of Metabase, like in this case.

This is a database from the erp system odoo.sh and they seem to block transactions, hence our questions was whether there would be a setting within metabase to avoid transaction pooling.

From Odoo Support:

Since a few month the odoo.sh changes the "odoosh-sql-access" to disable the possibility to perform PSQL transactions, see:
https://www.postgresql.org/docs/current/tutorial-transactions.html

Given the errors that you sent in your screenshot, I do assume the issue is related to this.

I do suppose that the app acts differently and the one on Mac OS do embed your request into a transaction automatically which close the connection. I can double check with odoo.sh team on the matter, but it is very likely the issue and will take some time.
If it is indeed the issue, then you will have to see if the application allow you to disable the PSQL transactions, otherwise, it will not be supported by this odoo.sh feature.”