Re: pgConn.cpp.patch
От | Dave Page |
---|---|
Тема | Re: pgConn.cpp.patch |
Дата | |
Msg-id | 03AF4E498C591348A42FC93DEA9661B83AF137@mail.vale-housing.co.uk обсуждение исходный текст |
Ответ на | pgConn.cpp.patch (Adam H.Pendleton <fmonkey@fmonkey.net>) |
Ответы |
Re: pgConn.cpp.patch
|
Список | pgadmin-hackers |
-----Original Message-----
From: Adam H. Pendleton [mailto:fmonkey@fmonkey.net]
Sent: 25 June 2003 14:40
To: Dave Page
Cc: pgadmin-hackers@postgresql.org
Subject: Re: [pgadmin-hackers] pgConn.cpp.patchDave Page wrote:
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.
Yes, this is because the PQsetClientEncoding fails because the connection failed. I've changed the preceeding code to:
// Set client encoding to Unicode/Ascii
if (PQstatus(conn) == CONNECTION_OK)
{
if (PQstatus(conn) == CONNECTION_OK)
{
#if wxUSE_UNICODE
wxLogInfo(wxT("Setting client_encoding to 'UNICODE'"));
...
...
which takes care of it.
Regards, Dave.
В списке pgadmin-hackers по дате отправления: