summaryrefslogtreecommitdiff
path: root/doc/src/sgml
diff options
context:
space:
mode:
authorTom Lane2006-03-02 21:49:19 +0000
committerTom Lane2006-03-02 21:49:19 +0000
commit69f69808c5c4185e729f489720e6c4c04efdd85b (patch)
tree39c97ed3e20776d05cf6ab93844424e83847a5c7 /doc/src/sgml
parent0138fb8697ecae27023eb3113a0e129b158f0da0 (diff)
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 'doc/src/sgml')
-rw-r--r--doc/src/sgml/lobj.sgml11
1 files changed, 6 insertions, 5 deletions
diff --git a/doc/src/sgml/lobj.sgml b/doc/src/sgml/lobj.sgml
index 98516082c97..ea9006e3746 100644
--- a/doc/src/sgml/lobj.sgml
+++ b/doc/src/sgml/lobj.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/lobj.sgml,v 1.37 2005/06/13 02:26:46 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/lobj.sgml,v 1.37.2.1 2006/03/02 21:49:19 tgl Exp $
-->
<chapter id="largeObjects">
@@ -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 &lt; 0)
{
fprintf(stderr, &quot;can't open large object %d\n&quot;,
@@ -553,7 +553,8 @@ overwrite(PGconn *conn, Oid lobjId, int start, int len)
}
/*
- * exportFile * export large object &quot;lobjOid&quot; to file &quot;out_filename&quot;
+ * exportFile
+ * export large object &quot;lobjOid&quot; to file &quot;out_filename&quot;
*
*/
void
@@ -566,7 +567,7 @@ exportFile(PGconn *conn, Oid lobjId, char *filename)
int fd;
/*
- * create an inversion &quot;object&quot;
+ * open the large object
*/
lobj_fd = lo_open(conn, lobjId, INV_READ);
if (lobj_fd &lt; 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)) &gt; 0)
{