mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Allow -t tablename to preserve case if specified as "tablename".
This commit is contained in:
@ -21,7 +21,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.103 1999/04/14 23:47:19 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.104 1999/05/04 15:47:35 thomas Exp $
|
||||||
*
|
*
|
||||||
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
|
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
|
||||||
*
|
*
|
||||||
@ -606,10 +606,21 @@ main(int argc, char **argv)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
tablename = strdup(optarg);
|
tablename = strdup(optarg);
|
||||||
for (i = 0; tablename[i]; i++)
|
/* quoted string? Then strip quotes and preserve case... */
|
||||||
if (isascii((unsigned char) tablename[i]) &&
|
if (tablename[0] == '"')
|
||||||
isupper(tablename[i]))
|
{
|
||||||
tablename[i] = tolower(tablename[i]);
|
strcpy(tablename, &tablename[1]);
|
||||||
|
if (*(tablename+strlen(tablename)-1) == '"')
|
||||||
|
*(tablename+strlen(tablename)-1) = '\0';
|
||||||
|
}
|
||||||
|
/* otherwise, convert table name to lowercase... */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (i = 0; tablename[i]; i++)
|
||||||
|
if (isascii((unsigned char) tablename[i]) &&
|
||||||
|
isupper(tablename[i]))
|
||||||
|
tablename[i] = tolower(tablename[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'v': /* verbose */
|
case 'v': /* verbose */
|
||||||
|
Reference in New Issue
Block a user