From: | "Andrea Urbani" <matfanjol(at)mail(dot)com> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | pg_dump: patterns and tables with uppercase letters |
Date: | 2016-12-21 11:35:56 |
Message-ID: | trinity-c423bad7-ca93-4754-92e8-5171ccdc4ad8-1482320156560@3capp-mailcom-lxa15 |
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 to everybody,</div>
<div>if you have table names with uppercase letters you will not be able to use the patterns in pg_dump.<br/>
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.<br/>
This means, i.e., that if your tables are called "tDocuments" and "tDocumentsFiles" if you call</div>
<div> pg_dump --dbname=healthorganizer --username=hor --table=tDocument*</div>
<div>processSQLNamePattern will output</div>
<div> c.relname ~ '^(tdocument*)$'</div>
<div>and if you use the double quote</div>
<div> pg_dump --dbname=healthorganizer --username=hor --table='"tDocument*"'</div>
<div>processSQLNamePattern will output</div>
<div> c.relname ~ '^(tDocument\*)$'</div>
<div>and both the instructions will not find those tables.</div>
<div>I suggest to add a parameter to the processSQLNamePattern function to choose between a case-sensitive or case-insensitive compare</div>
<div>c.relname ~ '^(tdocument*)$'<br/>
c.relname ~* '^(tdocument*)$'</div>
<div>and to use it in the expand_table_name_patterns method of pg_dump.c.</div>
<div>Bye<br/>
Andrea<br/>
matfanjol(at)user(dot)sf(dot)net</div>
<div> </div>
</div></div></body></html>
Attachment | Content-Type | Size |
---|---|---|
unknown_filename | text/html | 1.6 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2016-12-21 15:26:10 | Re: BUG #14471: PostgreSQL 9.6 "NOT IN" in select causes crash with "ERROR: unknown error" |
Previous Message | josef.machytka | 2016-12-21 09:44:43 | BUG #14471: PostgreSQL 9.6 "NOT IN" in select causes crash with "ERROR: unknown error" |