From: Tom Lane Date: Thu, 2 Mar 2006 21:56:14 +0000 (+0000) Subject: Remove unnecessary lo_lseek call in lo_open. Apparently there was once X-Git-Tag: REL8_2_BETA1~1329 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f0bfc02001c5f9a78fb3a5f72b97ffb35d526ec6;p=thirdparty%2Fpostgresql.git Remove unnecessary lo_lseek call in lo_open. Apparently there was once a need for it back in the neolithic era, but it's certainly dead code in any PG release we would recognize as such. Since it forces an additional network round trip to the backend, getting rid of it should provide some small performance improvement for large-object-using clients. --- diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 6745849c516..92c47b27f89 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/interfaces/libpq/fe-lobj.c,v 1.54 2005/10/15 02:49:48 momjian Exp $ + * $PostgreSQL: pgsql/src/interfaces/libpq/fe-lobj.c,v 1.55 2006/03/02 21:56:14 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -76,11 +76,6 @@ lo_open(PGconn *conn, Oid lobjId, int mode) if (PQresultStatus(res) == PGRES_COMMAND_OK) { PQclear(res); - - /* have to do this to reset offset in shared fd cache */ - /* but only if fd is valid */ - if (fd >= 0 && lo_lseek(conn, fd, 0L, SEEK_SET) < 0) - return -1; return fd; } else