 +PQerrorCode               138
 diff -urN postgresql-8.2.3/src/interfaces/libpq/fe-connect.c postgresql-8.2.3-tsnorri/src/interfaces/libpq/fe-connect.c
 --- postgresql-8.2.3/src/interfaces/libpq/fe-connect.c	2006-11-21 18:28:00.000000000 +0200
-+++ postgresql-8.2.3-tsnorri/src/interfaces/libpq/fe-connect.c	2007-03-01 16:28:44.000000000 +0200
++++ postgresql-8.2.3-tsnorri/src/interfaces/libpq/fe-connect.c	2007-03-05 16:56:02.000000000 +0200
 @@ -998,6 +998,8 @@
  
  			/* Special cases: proceed without waiting. */

 PGTransactionStatusType
 PQtransactionStatus(const PGconn *conn)
 {
@@ -3492,6 +3530,12 @@
 	return old;
 }
 

 								   conn->errorMessage.data) != STATUS_OK)
 				{
 					conn->errorMessage.len = strlen(conn->errorMessage.data);
+                    conn->errorCode = PGCONN_AUTH_FAILURE;
 					goto error_return;
 				}
 				conn->errorMessage.len = strlen(conn->errorMessage.data);
@@ -1680,7 +1707,7 @@
 				if (pqFlush(conn))
 					goto error_return;
 
