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  ("Adam H. Pendleton" <fmonkey@fmonkey.net>)
Список 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.patch

Dave 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 wxUSE_UNICODE
 
       wxLogInfo(wxT("Setting client_encoding to 'UNICODE'"));
 
...
...
 
which takes care of it.
 
Regards, Dave.

В списке pgadmin-hackers по дате отправления:

Предыдущее
От: Jean-Michel POURE
Дата:
Сообщение: Re: [pgadmin-support] PGA 3 Copy
Следующее
От: "Adam H. Pendleton"
Дата:
Сообщение: Re: pgConn.cpp.patch