git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9356877)
Fix ancient error in large objects usage example: overwrite() subroutine
Thu, 2 Mar 2006 21:49:09 +0000 (21:49 +0000)
Thu, 2 Mar 2006 21:49:09 +0000 (21:49 +0000)
was opening with INV_READ flag and then writing. Prior to 8.1 the backend
did not reject this, but now it does.


diff --git a/doc/src/sgml/lobj.sgml b/doc/src/sgml/lobj.sgml
index 98516082c971bbc18e73c3e79e1c6733f2d225fa..e2f98fb66549cb5f916da1e4a3c1829426eb80fd 100644 (file)
--- 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.38 2006年03月02日 21:49:09 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)
{
diff --git a/src/test/examples/testlo.c b/src/test/examples/testlo.c
index 83b4813eae4ed2149a5766da1d679af38abc786d..ae193352d10c7d0e6eb6e6483ce34abaffea7202 100644 (file)
--- 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.26 2006年03月02日 21:49:09 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)
{
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /