Remove unnecessary lo_lseek call in lo_open. Apparently there was once
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 2 Mar 2006 21:56:14 +0000 (21:56 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 2 Mar 2006 21:56:14 +0000 (21:56 +0000)
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.

src/interfaces/libpq/fe-lobj.c

index 6745849c51655ec4c2edfb93f386a28a816e2177..92c47b27f89a724ea106ba335156fd023788cbf2 100644 (file)
@@ -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