The callback must not escape normal flow control with exceptions, longjmp(...), etc. It must return normally. Several libpq functions parse a user-specified string to obtain connection parameters.