Skip to content

Commit 54067db

Browse files
author
Thomas G. Lockhart
committed
Allow -t tablename to preserve case if specified as "tablename".
1 parent 6b54977 commit 54067db

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 16 additions & 5 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.103 1999/04/14 23:47:19 tgl Exp $
24+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.104 1999/05/04 15:47:35 thomas Exp $
2525
*
2626
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
2727
*
@@ -606,10 +606,21 @@ main(int argc, char **argv)
606606
int i;
607607

608608
tablename = strdup(optarg);
609-
for (i = 0; tablename[i]; i++)
610-
if (isascii((unsigned char) tablename[i]) &&
611-
isupper(tablename[i]))
612-
tablename[i] = tolower(tablename[i]);
609+
/* quoted string? Then strip quotes and preserve case... */
610+
if (tablename[0] == '"')
611+
{
612+
strcpy(tablename, &tablename[1]);
613+
if (*(tablename+strlen(tablename)-1) == '"')
614+
*(tablename+strlen(tablename)-1) = '\0';
615+
}
616+
/* otherwise, convert table name to lowercase... */
617+
else
618+
{
619+
for (i = 0; tablename[i]; i++)
620+
if (isascii((unsigned char) tablename[i]) &&
621+
isupper(tablename[i]))
622+
tablename[i] = tolower(tablename[i]);
623+
}
613624
}
614625
break;
615626
case 'v': /* verbose */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy