Received: from localhost.jpl.nasa.gov (IDENT:root@hectic-1.jpl.nasa.gov [128.149.68.203]) by hub.org (8.9.3/8.9.3) with ESMTP id JAA64775 for ; Tue, 4 May 1999 09:55:40 -0400 (EDT) (envelope-from lockhart@alumni.caltech.edu) Received: from alumni.caltech.edu (lockhart@localhost [127.0.0.1]) by localhost.jpl.nasa.gov (8.8.7/8.8.7) with ESMTP id NAA06575; Tue, 4 May 1999 13:54:33 GMT Sender: lockhart@localhost.jpl.nasa.gov Message-ID: <372EFC19.7A9E6514@alumni.caltech.edu> Date: Tue, 04 May 1999 13:54:33 +0000 From: Thomas Lockhart X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.0.36 i686) X-Accept-Language: en MIME-Version: 1.0 To: "Ross J. Reedstrom" , Bruce Momjian CC: pgsql-sql@hub.org, "pgsql-hackers@postgreSQL.org" Subject: Re: [HACKERS] pg_dump bug (was Re: [SQL] Slow Inserts Again) References: <372DD66B.82BF86E3@rice.edu> Content-Type: multipart/mixed; boundary="------------F7A6E0F66B096231F0B8DFEE" This is a multi-part message in MIME format. --------------F7A6E0F66B096231F0B8DFEE Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit > ... pg_dump seems to have problems with mixed case tablenames. There > doesn't seem to be a way to send a quoted tablename into pg_dump as the > value for a -t option, in 6.4.2 (example below). Can someone try this on > 6.5beta? I know some issues with quoting output of pg_dump (i.e. COPY) > was addressed, I'm wondering if input parsing got touched. pg_dump explicitly converts all table names to lowercase. I've got a patch which looks for a table name which starts with a double quote, and suppresses the case conversion if so: [postgres@golem pg_dump]$ pg_dump -t '"MixedCase"' postgres CREATE TABLE "MixedCase" ( "i" int4); COPY "MixedCase" FROM stdin; 1 2 \. Patch enclosed for you to try. Bruce, any reason not to apply this to the tree? - Tom -- Thomas Lockhart lockhart@alumni.caltech.edu South Pasadena, California --------------F7A6E0F66B096231F0B8DFEE Content-Type: text/plain; charset=us-ascii; name="pg_dump.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pg_dump.c.patch" *** pg_dump.c.orig Thu Apr 15 05:08:53 1999 --- pg_dump.c Tue May 4 13:47:01 1999 *************** *** 606,615 **** int i; tablename = strdup(optarg); ! for (i = 0; tablename[i]; i++) ! if (isascii((unsigned char) tablename[i]) && ! isupper(tablename[i])) ! tablename[i] = tolower(tablename[i]); } break; case 'v': /* verbose */ --- 606,626 ---- int i; tablename = strdup(optarg); ! /* quoted string? Then strip quotes and preserve case... */ ! if (tablename[0] == '"') ! { ! 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; case 'v': /* verbose */ --------------F7A6E0F66B096231F0B8DFEE--