Skip to content

Cannot Reconnect to PostgreSQL After Connection Loss #2074

@mertkarakulak

Description

@mertkarakulak

Description

Issue Description:
I encountered an issue with HeidiSQL when using it to connect to PostgreSQL 16.x and 17.x. If the connection to the database is lost (e.g., due to network issues or server restarts), HeidiSQL is unable to recover the connection automatically.

Instead, it displays an error message and requires a full disconnect and reconnect to restore functionality. Simply retrying or attempting to refresh the session does not resolve the problem.

This behavior makes it inconvenient to work with environments where transient connection interruptions are common.

Environment:
HeidiSQL Version: 12.8.0.6908
PostgreSQL Version: 16.x and 17.x
PSQL Lib: libpg-16.dll
OS: Windows 11 23H2

Notes:
I have not tested this behavior with PostgreSQL versions earlier than 16.x.
It would be helpful if HeidiSQL could handle reconnections more gracefully for PostgreSQL databases.
Thank you for looking into this! Let me know if more details are needed.

HeidiSQL version

12.8.0.6908

Database server version

PostgreSQL 16.6.0

Reproduction recipe

Steps to Reproduce:

  • Connect to a PostgreSQL 16.x or 17.x instance using HeidiSQL.
  • Simulate a connection interruption (e.g., restart the PostgreSQL server or disconnect the network temporarily).
  • Try to execute a query or refresh the session after the connection is restored.
  • Observed Behavior:
  • HeidiSQL fails to reestablish the connection.
  • An error message is displayed.
  • A manual disconnect and reconnect are required to resume functionality.
  • Expected Behavior:
  • HeidiSQL should attempt to automatically reconnect to the PostgreSQL server after a connection loss, similar to how it handles connections with other database types (e.g., MySQL/MariaDB).
  • A manual reconnect should not be necessary.

Error/Backtrace

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDefective behaviour in HeidiSQLnettype-postgresqlPostgreSQL specific issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions