Re: pg_dump: patterns and tables with uppercase letters

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andrea Urbani <matfanjol(at)mail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: pg_dump: patterns and tables with uppercase letters
Date: 2016-12-22 04:32:02
Message-ID: CAB7nPqTTwbooE8RkZFV_A7MCiHzGf9MGC=7NxJZnJ==8A-QJdA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Dec 21, 2016 at 8:35 PM, Andrea Urbani <matfanjol(at)mail(dot)com> wrote:
> Hello to everybody,
> if you have table names with uppercase letters you will not be able to use
> the patterns in pg_dump.
> In particular the processSQLNamePattern function, inside
> src/fe_utils/strings_utils.c, is converting to lowercase when the text is
> not double quoted, but when it is double quoted, all the |*+?()[]{}.^$\
> characters are quoted.

You are missing the point here... The pattern analysis matches what is
done in psql. So you could do want you want by moving the regex
pattern out of the double quotes for example:
$ pg_dump --table '"tDocuments"*' | grep "CREATE TABLE" | grep tDocuments
CREATE TABLE "tDocuments" (
CREATE TABLE "tDocumentsFiles" (

The fine docs explain the full behavior here, the first paragraph
being especially explicit about the use of double quotes:
https://www.postgresql.org/docs/devel/static/app-psql.html#app-psql-patterns
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrea Urbani 2016-12-22 05:52:50 Re: pg_dump: patterns and tables with uppercase letters
Previous Message Tom Lane 2016-12-21 23:22:04 Re: BUG #14472: Backend crash​e​​s​ on array append for domains of array with constraint check