From: | "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk> |
---|---|
To: | "Adam H(dot) Pendleton" <fmonkey(at)fmonkey(dot)net> |
Cc: | <pgadmin-hackers(at)postgresql(dot)org> |
Subject: | Re: pgConn.cpp.patch |
Date: | 2003-06-25 14:46:40 |
Message-ID: | 03AF4E498C591348A42FC93DEA9661B83AF137@mail.vale-housing.co.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-hackers |
-----Original Message-----
From: Adam H. Pendleton [mailto:fmonkey(at)fmonkey(dot)net]
Sent: 25 June 2003 14:40
To: Dave Page
Cc: pgadmin-hackers(at)postgresql(dot)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.
From | Date | Subject | |
---|---|---|---|
Next Message | Adam H. Pendleton | 2003-06-25 14:50:52 | Re: pgConn.cpp.patch |
Previous Message | Jean-Michel POURE | 2003-06-25 13:57:11 | Re: [pgadmin-support] PGA 3 Copy |