From 35a952a2eda78993e3b5baa1d8c869e1254cd3e4 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 10 Jul 1997 01:15:11 +0000 Subject: [PATCH] Fixes from Jody Winston --- src/test/examples/testlo.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/test/examples/testlo.c b/src/test/examples/testlo.c index ac650a9dc5..cd69fbd75e 100644 --- a/src/test/examples/testlo.c +++ b/src/test/examples/testlo.c @@ -7,11 +7,17 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/test/examples/testlo.c,v 1.1.1.1 1996/07/09 06:22:23 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/test/examples/testlo.c,v 1.2 1997/07/10 01:15:11 momjian Exp $ * *------------------------------------------------------------------------- */ #include +#include + +#include +#include +#include + #include "libpq-fe.h" #include "libpq/libpq-fs.h" @@ -210,7 +216,11 @@ main(int argc, char **argv) PQclear(res); printf("importing file \"%s\" ...\n", in_filename); /* lobjOid = importFile(conn, in_filename); */ - lobjOid = lo_import(conn, in_filename); + lobjOid = lo_import(conn, in_filename); + if (lobjOid == 0) + { + fprintf(stderr,"%s\n",PQerrorMessage(conn)); + } /* printf("\tas large object %d.\n", lobjOid); @@ -223,7 +233,10 @@ main(int argc, char **argv) printf("exporting large object to file \"%s\" ...\n", out_filename); /* exportFile(conn, lobjOid, out_filename); */ - lo_export(conn, lobjOid,out_filename); + if (!lo_export(conn, lobjOid,out_filename)) + { + fprintf(stderr,"%s\n",PQerrorMessage(conn)); + } res = PQexec(conn, "end"); PQclear(res); -- 2.11.0