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