79631542

Date: 2025-05-21 08:19:14
Score: 1.5
Natty:
Report link

If npgsql driver version 7+

https://www.npgsql.org/doc/failover-and-load-balancing.html?tabs=7

Target Session Attributes=prefer-standby -> Target Session Attributes=PreferStandby

And:
// At startup: _preferStandbyDatASource = dataSource.WithTargetSession(TargetSessionAttributes.PreferStandby); // ... and wherever you need a connection: await using var connection = await _preferStandbyDatASource.OpenConnectionAsync();

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Cheshire