From 56aa84a69c282840afc3be3cba0b0e374373b9b4 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 2 Mar 2006 21:49:09 +0000 Subject: 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. --- doc/src/sgml/lobj.sgml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/lobj.sgml b/doc/src/sgml/lobj.sgml index 98516082c97..e2f98fb6654 100644 --- a/doc/src/sgml/lobj.sgml +++ b/doc/src/sgml/lobj.sgml @@ -1,5 +1,5 @@ @@ -527,7 +527,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 %d\n", @@ -553,7 +553,8 @@ overwrite(PGconn *conn, Oid lobjId, int start, int len) } /* - * exportFile * export large object "lobjOid" to file "out_filename" + * exportFile + * export large object "lobjOid" to file "out_filename" * */ void @@ -566,7 +567,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) @@ -586,7 +587,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) { -- cgit v1.2.3