Issue
When attempting to connect to or refresh a PostgreSQL data source on Tableau Online, or when dragging 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