Re: [pgadmin-hackers] pgConn.cpp.patch
-Original Message- From: Adam H.Pendleton [mailto:[EMAIL PROTECTED] Sent: 25 June 2003 03:02 To: [EMAIL PROTECTED] Subject: [pgadmin-hackers] pgConn.cpp.patch This patch fixes a bug in the error reporting of the new connection dialog when setting the database encoding. Hi Adam, I don't believe this patch is correct. PQsetClientEncoding returns 0 on success and -1 on failure [1], therefore !PQsetClientEncoding is true upon success. - if (PQsetClientEncoding(conn, UNICODE)) + if (!PQsetClientEncoding(conn, UNICODE)) wxLogError(wxT(%s), wxString(PQerrorMessage(conn), wxConvUTF8).c_str()); Patch NOT applied. Regards, Dave. [1] http://www.postgresql.org/docs/view.php?version=7.3idoc=0file=multibyt e.html ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [pgadmin-hackers] pgConn.cpp.patch
Dave Page wrote: Message Yes, this is because the PQsetClientEncoding fails becausethe connection failed. I've changed the preceeding code to: // Set client encoding to Unicode/Ascii if (PQstatus(conn) == CONNECTION_OK) { #if wxUSE_UNICODE wxLogInfo(wxT("Setting client_encoding to 'UNICODE'")); ... ... which takes care of it. Regards, Dave. Doh! Of course it fails. Well, at least this saves me from having to figure out what I missed. BTW, if PQsetClientEncoding fails, which it does, then why would the error come up as a password error? Does that mean that PQsetClientEncoding doesn't change the Postgres errors like other PQ functions? ahp
[pgadmin-hackers] pgConn.cpp.patch
This patch fixes a bug in the error reporting of the new connection dialog when setting the database encoding. ahp pgConn.cpp.patch Description: Binary data PGP.sig Description: PGP signature