Skip to content

Commit 2ed7b03

Browse files
committed
Fix -t for pg_dump when table is uppercase.
1 parent e0aab4a commit 2ed7b03

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
*
2323
* IDENTIFICATION
24-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.62 1998/01/30 15:03:35 scrappy Exp $
24+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.63 1998/02/18 15:33:37 momjian Exp $
2525
*
2626
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
2727
*
@@ -55,6 +55,7 @@
5555
#include <unistd.h> /* for getopt() */
5656
#include <stdio.h>
5757
#include <string.h>
58+
#include <ctype.h>
5859
#include <sys/param.h> /* for MAXHOSTNAMELEN on most */
5960
#ifdef sparc_solaris
6061
#include <netdb.h> /* for MAXHOSTNAMELEN on some */
@@ -119,7 +120,7 @@ static void
119120
usage(const char *progname)
120121
{
121122
fprintf(stderr,
122-
"usage: %s [options] [dbname]\n", progname);
123+
"usage: %s [options] dbname\n", progname);
123124
fprintf(stderr,
124125
"\t -a \t\t dump out only the data, no schema\n");
125126
fprintf(stderr,
@@ -531,7 +532,7 @@ main(int argc, char **argv)
531532
const char *dbname = NULL;
532533
const char *pghost = NULL;
533534
const char *pgport = NULL;
534-
const char *tablename = NULL;
535+
char *tablename = NULL;
535536
int oids = 0,
536537
acls = 0;
537538
TableInfo *tblinfo;
@@ -583,7 +584,14 @@ main(int argc, char **argv)
583584
schemaOnly = 1;
584585
break;
585586
case 't': /* Dump data for this table only */
586-
tablename = optarg;
587+
{
588+
int i;
589+
590+
tablename = strdup(optarg);
591+
for (i = 0; tablename[i]; i++)
592+
if (isupper(tablename[i]))
593+
tablename[i] = tolower(tablename[i]);
594+
}
587595
break;
588596
case 'v': /* verbose */
589597
g_verbose = true;

0 commit comments

Comments
 (0)