Handle DB Fail-over on postgres

Can anyone help with the following?

Upvotes: 0

Views: 208

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 247625

TAF is partly a lie - data modifying statements won't fail over. And no, there is no such thing in PostgreSQL.

I don't see the need for a timer. What you do to make your application resilient to failovers is to examine the SQLSTATE of the error you got, and if it indicates connection loss, you repeat the transaction. Keep a count so that you don't end up looping endlessly if the error is persistent.

Upvotes: 1

Related Questions