mirror of
https://github.com/postgres/postgres.git
synced 2025-07-17 06:41:09 +03:00
Remove un-needed braces around single statements.
This commit is contained in:
@ -102,18 +102,14 @@ main()
|
||||
/* first, print out the attribute names */
|
||||
nFields = PQnfields(res);
|
||||
for (i = 0; i < nFields; i++)
|
||||
{
|
||||
printf("%-15s", PQfname(res, i));
|
||||
}
|
||||
printf("\n\n");
|
||||
|
||||
/* next, print out the instances */
|
||||
for (i = 0; i < PQntuples(res); i++)
|
||||
{
|
||||
for (j = 0; j < nFields; j++)
|
||||
{
|
||||
printf("%-15s", PQgetvalue(res, i, j));
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
@ -121,18 +121,14 @@ main(int argc, char **argv)
|
||||
/* first, print out the attribute names */
|
||||
nFields = PQnfields(res1);
|
||||
for (i = 0; i < nFields; i++)
|
||||
{
|
||||
printf("%-15s", PQfname(res1, i));
|
||||
}
|
||||
printf("\n\n");
|
||||
|
||||
/* next, print out the instances */
|
||||
for (i = 0; i < PQntuples(res1); i++)
|
||||
{
|
||||
for (j = 0; j < nFields; j++)
|
||||
{
|
||||
printf("%-15s", PQgetvalue(res1, i, j));
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/test/examples/testlo.c,v 1.8 1998/05/12 21:44:07 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/test/examples/testlo.c,v 1.9 1998/06/15 19:30:31 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -53,9 +53,7 @@ importFile(PGconn *conn, char *filename)
|
||||
*/
|
||||
lobjId = lo_creat(conn, INV_READ | INV_WRITE);
|
||||
if (lobjId == 0)
|
||||
{
|
||||
fprintf(stderr, "can't create large object");
|
||||
}
|
||||
|
||||
lobj_fd = lo_open(conn, lobjId, INV_WRITE);
|
||||
|
||||
@ -66,9 +64,7 @@ importFile(PGconn *conn, char *filename)
|
||||
{
|
||||
tmp = lo_write(conn, lobj_fd, buf, nbytes);
|
||||
if (tmp < nbytes)
|
||||
{
|
||||
fprintf(stderr, "error while reading \"%s\"", filename);
|
||||
}
|
||||
}
|
||||
|
||||
close(fd);
|
||||
@ -241,9 +237,7 @@ main(int argc, char **argv)
|
||||
/* lobjOid = importFile(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);
|
||||
|
||||
@ -257,9 +251,7 @@ main(int argc, char **argv)
|
||||
printf("exporting large object to file \"%s\" ...\n", out_filename);
|
||||
/* exportFile(conn, lobjOid, out_filename); */
|
||||
if (!lo_export(conn, lobjOid, out_filename))
|
||||
{
|
||||
fprintf(stderr, "%s\n", PQerrorMessage(conn));
|
||||
}
|
||||
|
||||
res = PQexec(conn, "end");
|
||||
PQclear(res);
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/test/examples/Attic/testlo2.c,v 1.7 1998/05/12 21:44:08 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/test/examples/Attic/testlo2.c,v 1.8 1998/06/15 19:30:31 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -49,9 +49,7 @@ importFile(PGconn *conn, char *filename)
|
||||
*/
|
||||
lobjId = lo_creat(conn, INV_READ | INV_WRITE);
|
||||
if (lobjId == 0)
|
||||
{
|
||||
fprintf(stderr, "can't create large object");
|
||||
}
|
||||
|
||||
lobj_fd = lo_open(conn, lobjId, INV_WRITE);
|
||||
|
||||
@ -62,9 +60,7 @@ importFile(PGconn *conn, char *filename)
|
||||
{
|
||||
tmp = lo_write(conn, lobj_fd, buf, nbytes);
|
||||
if (tmp < nbytes)
|
||||
{
|
||||
fprintf(stderr, "error while reading \"%s\"", filename);
|
||||
}
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
Reference in New Issue
Block a user