mirror of https://github.com/postgres/postgres
Fixes from Jody Winston
This commit is contained in:
parent
a5d80cb0cf
commit
35a952a2ed
|
@ -7,11 +7,17 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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 <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
#include "libpq-fe.h"
|
#include "libpq-fe.h"
|
||||||
#include "libpq/libpq-fs.h"
|
#include "libpq/libpq-fs.h"
|
||||||
|
|
||||||
|
@ -211,6 +217,10 @@ main(int argc, char **argv)
|
||||||
printf("importing file \"%s\" ...\n", in_filename);
|
printf("importing file \"%s\" ...\n", in_filename);
|
||||||
/* lobjOid = importFile(conn, 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);
|
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);
|
printf("exporting large object to file \"%s\" ...\n", out_filename);
|
||||||
/* exportFile(conn, lobjOid, 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");
|
res = PQexec(conn, "end");
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
|
|
Loading…
Reference in New Issue