Dave Page wrote:
-----Original Message-----
From: Adam H.Pendleton [mailto:fmonkey@fmonkey.net]
Sent: 25 June 2003 03:02
To: pgadmin-hackers@postgresql.org
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.
The docs may say that, but I can tell you that:
if (PQsetClientEncoding(conn, "SQL_ASCII"))
wxLogError(wxT("%s"), PQerrorMessage(conn));
causes wxLogError to be run, if there was an error in the connection. For example, try connecting to a postgres database with an incorrect password. You will get *two* password incorrect dialogs. The first is displayed by the above code.
ahp