summaryrefslogtreecommitdiff
path: root/psycopg/connection_int.c
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2010-04-21 13:22:09 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2010-04-21 15:31:07 +0100
commitd71520db9a7fdd4739677ad066fd8a3d9b118d75 (patch)
tree36f71ba097b1f82edafb6533836f32d39e4f07b6 /psycopg/connection_int.c
parent8fed0aa57d588c3655423a3d25ece01662719836 (diff)
downloadpsycopg2-d71520db9a7fdd4739677ad066fd8a3d9b118d75.tar.gz
Read the server version only after connection established.
Diffstat (limited to 'psycopg/connection_int.c')
-rw-r--r--psycopg/connection_int.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/psycopg/connection_int.c b/psycopg/connection_int.c
index dd80576..e564cfc 100644
--- a/psycopg/connection_int.c
+++ b/psycopg/connection_int.c
@@ -374,8 +374,6 @@ conn_sync_connect(connectionObject *self)
Dprintf("conn_connect: using protocol %d", self->protocol);
- self->server_version = (int)PQserverVersion(pgconn);
-
/* if the connection is green, wait to finish connection */
if (green) {
wait_rv = psyco_wait(self);
@@ -386,6 +384,8 @@ conn_sync_connect(connectionObject *self)
}
}
+ self->server_version = (int)PQserverVersion(pgconn);
+
/* From here the connection is considered ready: with the new status,
* poll() will use PQisBusy instead of PQconnectPoll.
*/