Skip to content

Database restarts are not handled gracefully #672

@ellulpatrick

Description

@ellulpatrick

When the database is rebooted gracefully, it sends an <E meaning FATAL: terminating connection due to administrator command (SQLSTATE 57P01)

lib/pq discards such connection upfront and the next execution attempts to create a new connection.

Pgx returns an error at the next execution which is a wasted error, because typically the database has already rebooted, or a hot replica is already available,

How can we make pgx realise upfront of similar problems with the connection so that we don't waste a usage attempt with an error when we didn't need to?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions