diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-02 21:49:19 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-02 21:49:19 +0000 |
commit | 69f69808c5c4185e729f489720e6c4c04efdd85b (patch) | |
tree | 39c97ed3e20776d05cf6ab93844424e83847a5c7 /src | |
parent | 0138fb8697ecae27023eb3113a0e129b158f0da0 (diff) | |
download | postgresql-69f69808c5c4185e729f489720e6c4c04efdd85b.tar.gz postgresql-69f69808c5c4185e729f489720e6c4c04efdd85b.zip |
Fix ancient error in large objects usage example: overwrite() subroutine
was opening with INV_READ flag and then writing. Prior to 8.1 the backend
did not reject this, but now it does.
Diffstat (limited to 'src')
-rw-r--r-- | src/test/examples/testlo.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/examples/testlo.c b/src/test/examples/testlo.c index 83b4813eae4..3ff6fe7bbb9 100644 --- a/src/test/examples/testlo.c +++ b/src/test/examples/testlo.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/test/examples/testlo.c,v 1.25 2004/12/31 22:03:58 pgsql Exp $ + * $PostgreSQL: pgsql/src/test/examples/testlo.c,v 1.25.6.1 2006/03/02 21:49:19 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -113,7 +113,7 @@ overwrite(PGconn *conn, Oid lobjId, int start, int len) int nwritten; int i; - lobj_fd = lo_open(conn, lobjId, INV_READ); + lobj_fd = lo_open(conn, lobjId, INV_WRITE); if (lobj_fd < 0) fprintf(stderr, "can't open large object %u", lobjId); @@ -156,7 +156,7 @@ exportFile(PGconn *conn, Oid lobjId, char *filename) int fd; /* - * create an inversion "object" + * open the large object */ lobj_fd = lo_open(conn, lobjId, INV_READ); if (lobj_fd < 0) @@ -173,7 +173,7 @@ exportFile(PGconn *conn, Oid lobjId, char *filename) } /* - * read in from the Unix file and write to the inversion file + * read in from the inversion file and write to the Unix file */ while ((nbytes = lo_read(conn, lobj_fd, buf, BUFSIZE)) > 0) { |