KNOWLEDGE BASE

Error "error: Current Transaction Is Aborted, Commands Ignored Until End Of Transaction Block; Error While Executing The Query" when connecting or interacting with Postgresql Data Source.


Published: 19 Dec 2019
Last Modified Date: 19 Mar 2020

Issue

When attempting to connect to or refresh a PostgreSQL data source on Tableau Online, or when drag any measure or dimension to the columns/Rows shelf after the connection is made, the following error may occur:

An error occurred while communicating with PostgreSQL
Bad Connection: Tableau could not connect to the data source
ERROR: current transaction is aborted, commands ignored until end of transaction block; Error while executing the query

Environment

  • Tableau Online
  • Tableau Desktop
  • PostgreSQL Database 12.1

Resolution

1. Workarounds for scenario 1: When attempting to connect to or refresh a PostgreSQL data source on Tableau Online.

Option 1:
Use Tableau Bridge with a version of the driver where the issue does not occur: For more information see Expand Data Freshness Options by Using Tableau Bridge

Option 2:
Use Tableau Data Extract Command Line Utility with a version of the driver where the issue does not occur: For more information see Tableau Data Extract Command-Line Utility

Option 3:
Use Tableau Desktop Refresh from Source with a version of the driver where the issue does not occur: For more information see Refresh Published Extracts from Tableau Desktop

2. Workaround for scenario 2: when drag any measure or dimension to the columns/Rows shelf after the connection to PostgreSQL is made.
  • Uninstall the current version of the PostgreSQL driver installed on the machine.
  • Install the latest version of PostgreSQL driver, version 12.1. Note: the latest Postgres driver could be  found here: https://www.postgresql.org/ftp/odbc/versions/msi/

Cause

This issue is caused by PostgreSQL driver.  Some PostgreSQL driver version does not properly handle the cancel request. Because the driver did not properly handle the cancel request, It believe the transaction is still available and attempts to run queries off of it and cause things to break.
Did this article resolve the issue?