pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <maillist@candle.pha.pa.us>
To: Thomas Lockhart <lockhart@alumni.caltech.edu>
Cc: Ross J. Reedstrom <reedstrm@rice.edu>
Cc: pgsql-sql@hub.org, "pgsql-hackers@postgreSQL.org" <pgsql-hackers@postgreSQL.org>
Subject: Re: [HACKERS] pg_dump bug (was Re: [SQL] Slow Inserts Again)
Date: Tue, 4 May 1999 12:55:40 -0400 (EDT)
Message-ID: <199905041655.MAA28855@candle.pha.pa.us> (raw)
In-Reply-To: <372EFC19.7A9E6514@alumni.caltech.edu>

Apply, please.  It is a bug fix.

> > ... 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

> *** 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 */


-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



view thread (4+ messages)  latest in thread

Message-ID: <199905041655.MAA28855@candle.pha.pa.us>
Permalink:  ../199905041655.MAA28855@candle.pha.pa.us/
Also on:    postgresql.org/message-id/199905041655.MAA28855@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: maillist@candle.pha.pa.us, lockhart@alumni.caltech.edu, reedstrm@rice.edu, pgsql-hackers@postgreSQL.org
  Subject: Re: [HACKERS] pg_dump bug (was Re: [SQL] Slow Inserts Again)
  In-Reply-To: <199905041655.MAA28855@candle.pha.pa.us>
  References: <372EFC19.7A9E6514@alumni.caltech.edu> <199905041655.MAA28855@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox