[BUGS] pg_dump: patterns and tables with uppercase letters

Поиск
Список
Период
Сортировка
От Andrea Urbani
Тема [BUGS] pg_dump: patterns and tables with uppercase letters
Дата
Msg-id trinity-c423bad7-ca93-4754-92e8-5171ccdc4ad8-1482320156560@3capp-mailcom-lxa15
обсуждение исходный текст
Ответы Re: [BUGS] pg_dump: patterns and tables with uppercase letters  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-bugs
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.
This means, i.e., that if your tables are called  "tDocuments" and "tDocumentsFiles" if you call
    pg_dump --dbname=healthorganizer --username=hor --table=tDocument*
processSQLNamePattern will output
    c.relname ~ '^(tdocument*)$'
and if you use the double quote
    pg_dump --dbname=healthorganizer --username=hor --table='"tDocument*"'
processSQLNamePattern will output
    c.relname ~ '^(tDocument\*)$'
and both the instructions will not find those tables.
I suggest to add a parameter to the processSQLNamePattern function to choose between a case-sensitive or case-insensitive compare
c.relname ~ '^(tdocument*)$'
c.relname ~* '^(tdocument*)$'
and to use it in the expand_table_name_patterns method of pg_dump.c.
Bye
Andrea
matfanjol@user.sf.net
 

В списке pgsql-bugs по дате отправления:

Предыдущее
От: josef.machytka@gmail.com
Дата:
Сообщение: [BUGS] BUG #14471: PostgreSQL 9.6 "NOT IN" in select causes crash with"ERROR: unknown error"
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [BUGS] BUG #14471: PostgreSQL 9.6 "NOT IN" in select causes crash with "ERROR: unknown error"