1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-08 06:02:22 +03:00

Update to /contrib from Karel.

This commit is contained in:
Bruce Momjian
2000-06-19 13:54:50 +00:00
parent b2c56574e1
commit 6de7d4fe91
87 changed files with 257 additions and 1645 deletions

View File

@@ -4,7 +4,7 @@
*
* Portions Copyright (c) 1999-2000, PostgreSQL, Inc
*
* $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/main.c,v 1.1 2000/06/15 19:05:08 momjian Exp $
* $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/main.c,v 1.2 2000/06/19 13:54:01 momjian Exp $
*
* Karel Zak 1999-2000
* -------------------------------------------------------------------------
@@ -152,13 +152,18 @@ main(int argc, char **argv)
* Check space
* ----------
*/
if (! pgLO->space) {
if (! pgLO->space && ! pgLO->action == ACTION_SHOW) {
if (!(pgLO->space = getenv("PWD"))) {
fprintf(stderr, "%s: not set space for dump-tree (option '-s' or $PWD).\n", progname);
exit(RE_ERROR);
}
}
if (!pgLO->action) {
fprintf(stderr, "%s: What do you want - export or import?\n", progname);
exit(RE_ERROR);
}
/* ----------
* Make connection
* ----------
@@ -179,12 +184,8 @@ main(int argc, char **argv)
* Init index file
* ----------
*/
if (pgLO->action) {
if (pgLO->action != ACTION_SHOW)
index_file(pgLO);
} else {
fprintf(stderr, "%s: What do you want - export or import?\n", progname);
exit(RE_ERROR);
}
PQexec(pgLO->conn, "BEGIN");
@@ -198,7 +199,7 @@ main(int argc, char **argv)
pglo_export(pgLO);
if (!pgLO->quiet) {
if (pgLO->action == ACTION_SHOW)
printf("\nDatabase '%s' content %d large objects.\n\n", pgLO->db, pgLO->counter);
printf("\nDatabase '%s' contains %d large objects.\n\n", pgLO->db, pgLO->counter);
else
printf("\nExported %d large objects.\n\n", pgLO->counter);
}