Since the connection string test works but the archive modules still force port 5432, it sounds like ModArcPostgreSql may be using a separate/default connection configuration. I’d check the archive module’s own configuration and whether a newer Rapid SCADA version addresses the port handling.