سؤال

If I try to establish a connection via PQconnectdb and it fails, is it ok to call PQreset on PGconn* to retry or does it only work if I've already been connected once?

هل كانت مفيدة؟

المحلول

If the connection attempt is failed because of some invalid connections options (error like invalid connection options) than calling the PQreset will also fail. But for cases where all arguments to the PQconnectdb were correct and connection was unsuccessful because of reasons like remote server was busy or not accepting the new connections than PQreset will work just fine.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top