Re: pg_dump: patterns and tables with uppercase letters

From: "Andrea Urbani" <matfanjol(at)mail(dot)com>
To: "Michael Paquier" <michael(dot)paquier(at)gmail(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 05:52:50
Message-ID: trinity-aedbc098-e013-4a69-adfd-a5c45eabb0d7-1482385970017@3capp-mailcom-lxa02
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Hello Michael,</div>

<div>it works: thank you and sorry.</div>

<div>Bye</div>

<div>Andrea</div>

<div>&nbsp;
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Sent:</b>&nbsp;Thursday, December 22, 2016 at 5:32 AM<br/>
<b>From:</b>&nbsp;&quot;Michael Paquier&quot; &lt;michael(dot)paquier(at)gmail(dot)com&gt;<br/>
<b>To:</b>&nbsp;&quot;Andrea Urbani&quot; &lt;matfanjol(at)mail(dot)com&gt;<br/>
<b>Cc:</b>&nbsp;&quot;PostgreSQL mailing lists&quot; &lt;pgsql-bugs(at)postgresql(dot)org&gt;<br/>
<b>Subject:</b>&nbsp;Re: [BUGS] pg_dump: patterns and tables with uppercase letters</div>

<div name="quoted-content">On Wed, Dec 21, 2016 at 8:35 PM, Andrea Urbani &lt;matfanjol(at)mail(dot)com&gt; wrote:<br/>
&gt; Hello to everybody,<br/>
&gt; if you have table names with uppercase letters you will not be able to use<br/>
&gt; the patterns in pg_dump.<br/>
&gt; In particular the processSQLNamePattern function, inside<br/>
&gt; src/fe_utils/strings_utils.c, is converting to lowercase when the text is<br/>
&gt; not double quoted, but when it is double quoted, all the &#124;*+?()[]{}.^&#36;&#92;<br/>
&gt; characters are quoted.<br/>
<br/>
You are missing the point here... The pattern analysis matches what is<br/>
done in psql. So you could do want you want by moving the regex<br/>
pattern out of the double quotes for example:<br/>
&#36; pg_dump --table &#39;&quot;tDocuments&quot;*&#39; &#124; grep &quot;CREATE TABLE&quot; &#124; grep tDocuments<br/>
CREATE TABLE &quot;tDocuments&quot; (<br/>
CREATE TABLE &quot;tDocumentsFiles&quot; (<br/>
<br/>
The fine docs explain the full behavior here, the first paragraph<br/>
being especially explicit about the use of double quotes:<br/>
<a href="https://www.postgresql.org/docs/devel/static/app-psql.html#app-psql-patterns" target="_blank">https://www.postgresql.org/docs/devel/static/app-psql.html#app-psql-patterns</a><br/>
--<br/>
Michael</div>
</div>
</div>
</div></div></body></html>

Attachment Content-Type Size
unknown_filename text/html 2.1 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Kartashov 2016-12-22 11:01:22 Can't build uuid-ossp extension from source
Previous Message Michael Paquier 2016-12-22 04:32:02 Re: pg_dump: patterns and tables with uppercase letters