Re: Changes to pg_dump/psql following collation "C" in the catalog - Mailing list pgsql-hackers

From Daniel Verite
Subject Re: Changes to pg_dump/psql following collation "C" in the catalog
Date
Msg-id 1247dcf3-f3bd-4047-9a0a-6a047377db84@manitou-mail.org
Whole thread Raw
In response to Re: Changes to pg_dump/psql following collation "C" in the catalog  (Chapman Flack <chap@anastigmatix.net>)
List pgsql-hackers
    Chapman Flack wrote:

> >> "Daniel Verite" <daniel@manitou-mail.org> writes:
> >>> One consequence of using the "C" collation in the catalog versus
> >>> the db collation
>
> As an intrigued Person Following At Home, I was happy when I found
> this little three-message thread had more context in [1] and [2]. :)
>
> -Chap
>
> [1] https://postgr.es/m/15938.1544377821@sss.pgh.pa.us
> [2] https://postgr.es/m/5978.1544030694@sss.pgh.pa.us

Yes. The concrete issue that the patch addresses can be illustrated
with this example:

  psql (12devel)
  Type "help" for help.

  postgres=# show lc_collate ;
   lc_collate
  -------------
   fr_FR.UTF-8
  (1 row)

  postgres=# create table année_2018();
  CREATE TABLE

  postgres=# \dt '\\w+_\\d+'
  psql: error: Did not find any relation named "\w+_\d+".

In previous versions it would have found the table with the accent
in the name. With 12devel it doesn't, because the match is done with
the collation of the column, now "C", which does not consider the
accented character to be a letter.
This also affects pg_dump with the -t and -n switches that
accept patterns and I think pretty much all \d* commands
that accept patterns too.

The purpose of the fix is for the patterns to give the same results as
before. It's done by simply adding explicit collate clauses to use the
collation of the database for these comparisons.


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



pgsql-hackers by date:

Previous
From: Surafel Temesgen
Date:
Subject: Re: FETCH FIRST clause PERCENT option
Next
From: Stephen Frost
Date:
Subject: Re: [PATCH v20] GSSAPI encryption support