Changes to pg_dump/psql following collation "C" in the catalog

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Changes to pg_dump/psql following collation "C" in the catalog
Date: 2018-12-21 15:15:17
Message-ID: 701e51f0-0ec0-4e70-a365-1958d66dd8d2@manitou-mail.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

One consequence of using the "C" collation in the catalog versus
the db collation is that pg_dump -t with a regexp may not find
the same tables as before. It happens when these conditions are
all met:
- the collation of the database is not "C"
- the regexp has locale-dependant parts
- the names to match include characters that are sensitive to
locale-dependant matching

For instance a table named "rapport_journée_12" in an fr_FR.UTF-8 db
used to be found by pg_dump -t 'rapport_\w+_\d+', and is now missed
in the devel version.

It seems that to fix that, we could qualify the references to columns such
as "relname" and "schema_name" with COLLATE "default" clauses in the
queries that use pattern-matching in client-side tools, AFAICS
pg_dump and psql.

Before going any further with this idea, is there agreement that it's an
issue to address and does this look like the best way to do that?

Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-12-21 15:17:23 Re: tickling the lesser contributor's withering ego
Previous Message Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?= 2018-12-21 15:14:36 Re: [PATCH] Improve tab completion for CREATE TABLE