What happens?
If you encounter an idle-in-transaction termination in psql the error message sent to the end user shows that this was in fact the reason why their connection was closed. In duckdb-postgres the reported error message is much more ambiguous and does not mention idle-in-transaction at all.
I think the issue has to do with this line. Possibly there is more to the error message than what is returned by the PQresultErrorMessage function.
To Reproduce
To recreate first set up a postgres instance on localhost with on port 5432
duckdb-postgres
> import duckdb
> duckdb.install_extension('postgres')
> duckdb.load_extension('postgres')
> duckdb.sql(f"ATTACH 'user=postgres host=localhost' AS db (TYPE postgres, READ_ONLY);")
> duckdb.sql("SELECT * FROM postgres_query('db', 'begin; SELECT pg_sleep(10);')")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
_duckdb.Error: Failed to execute query "ROLLBACK": server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
Expected (psql)
> begin;
BEGIN
> -- wait a few second
> select 1;
FATAL: terminating connection due to idle-in-transaction timeout
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
OS:
linux
PostgreSQL Version:
17.6
DuckDB Version:
1.4.1
DuckDB Client:
python
Full Name:
Andrew Jackson
Affiliation:
Andrew Jackson
Have you tried this on the latest main branch?
Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
What happens?
If you encounter an idle-in-transaction termination in psql the error message sent to the end user shows that this was in fact the reason why their connection was closed. In
duckdb-postgresthe reported error message is much more ambiguous and does not mentionidle-in-transactionat all.I think the issue has to do with this line. Possibly there is more to the error message than what is returned by the
PQresultErrorMessagefunction.To Reproduce
To recreate first set up a postgres instance on localhost with on port 5432
duckdb-postgres
Expected (psql)
OS:
linux
PostgreSQL Version:
17.6
DuckDB Version:
1.4.1
DuckDB Client:
python
Full Name:
Andrew Jackson
Affiliation:
Andrew Jackson
Have you tried this on the latest
mainbranch?Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?