Fix -t for pg_dump when table is uppercase.

This commit is contained in:
Bruce Momjian 1998-02-18 15:33:37 +00:00
parent e0aab4aa9e
commit 2ed7b03c46

View File

@ -21,7 +21,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.62 1998/01/30 15:03:35 scrappy Exp $ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.63 1998/02/18 15:33:37 momjian Exp $
* *
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb * Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
* *
@ -55,6 +55,7 @@
#include <unistd.h> /* for getopt() */ #include <unistd.h> /* for getopt() */
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <ctype.h>
#include <sys/param.h> /* for MAXHOSTNAMELEN on most */ #include <sys/param.h> /* for MAXHOSTNAMELEN on most */
#ifdef sparc_solaris #ifdef sparc_solaris
#include <netdb.h> /* for MAXHOSTNAMELEN on some */ #include <netdb.h> /* for MAXHOSTNAMELEN on some */
@ -119,7 +120,7 @@ static void
usage(const char *progname) usage(const char *progname)
{ {
fprintf(stderr, fprintf(stderr,
"usage: %s [options] [dbname]\n", progname); "usage: %s [options] dbname\n", progname);
fprintf(stderr, fprintf(stderr,
"\t -a \t\t dump out only the data, no schema\n"); "\t -a \t\t dump out only the data, no schema\n");
fprintf(stderr, fprintf(stderr,
@ -531,7 +532,7 @@ main(int argc, char **argv)
const char *dbname = NULL; const char *dbname = NULL;
const char *pghost = NULL; const char *pghost = NULL;
const char *pgport = NULL; const char *pgport = NULL;
const char *tablename = NULL; char *tablename = NULL;
int oids = 0, int oids = 0,
acls = 0; acls = 0;
TableInfo *tblinfo; TableInfo *tblinfo;
@ -583,7 +584,14 @@ main(int argc, char **argv)
schemaOnly = 1; schemaOnly = 1;
break; break;
case 't': /* Dump data for this table only */ case 't': /* Dump data for this table only */
tablename = optarg; {
int i;
tablename = strdup(optarg);
for (i = 0; tablename[i]; i++)
if (isupper(tablename[i]))
tablename[i] = tolower(tablename[i]);
}
break; break;
case 'v': /* verbose */ case 'v': /* verbose */
g_verbose = true; g_verbose = true;