diff options
author | Bruce Momjian <bruce@momjian.us> | 1999-10-10 17:00:26 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1999-10-10 17:00:26 +0000 |
commit | 65a2c8f5b82961a9e651e9d95d1920ebdbff04a2 (patch) | |
tree | 6adf2b9fd5bc4486956c5a2f2e9805f4b14de3c2 /src | |
parent | 588356320821afc10d006ba7cb5b4d337bfc8172 (diff) | |
download | postgresql-65a2c8f5b82961a9e651e9d95d1920ebdbff04a2.tar.gz postgresql-65a2c8f5b82961a9e651e9d95d1920ebdbff04a2.zip |
Improve pg_dump template1 error reports.
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/pg_dump/pg_dump.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index f89deedde2a..c3eb2ea96d4 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -21,7 +21,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.121 1999/10/10 14:42:44 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.122 1999/10/10 17:00:26 momjian Exp $ * * Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb * @@ -3075,11 +3075,16 @@ findLastBuiltinOid(void) exit_nicely(g_conn); } ntups = PQntuples(res); - if (ntups != 1) + if (ntups < 1) { fprintf(stderr,"pg_dump: couldn't find the template1 database.\n"); - fprintf(stderr,"Check the table pg_database for a problem.\n"); - fprintf(stderr,"There should be exactly one 'template1' entry\n"); + fprintf(stderr,"There is no 'template1' entry in the 'pg_database' table.\n"); + exit_nicely(g_conn); + } + if (ntups > 1) + { + fprintf(stderr,"pg_dump: found more than one template1 database.\n"); + fprintf(stderr,"There is more than one 'template1' entry in the 'pg_database' table\n"); exit_nicely(g_conn); } last_oid = atoi(PQgetvalue(res, 0, PQfnumber(res, "oid"))); |