Preserve versions of initdb-created collations in pg_upgrade - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Preserve versions of initdb-created collations in pg_upgrade
Date
Msg-id aeb9e99a-f296-d81b-8e44-ff96c68473b7@2ndquadrant.com
Whole thread Raw
Responses Re: Preserve versions of initdb-created collations in pg_upgrade
List pgsql-hackers
As mentioned in [0], pg_upgrade currently does not preserve the version 
of collation objects created by initdb.  Here is an attempt to fix that.

The way I deal with this here is by having the binary-upgrade mode in 
pg_dump delete all the collations created by initdb and then dump out 
CREATE COLLATION commands with version information normally.

I had originally imagined doing some kind of ALTER COLLATION (or perhaps 
a direct UPDATE pg_collation) to update the version information, but 
that doesn't really work because we don't know whether the collation 
object with a given name in the new cluster is the same as the one in 
the old cluster.  So it seems more robust to just delete all existing 
collations and create them from scratch.

Thoughts?


[0]: 
https://www.postgresql.org/message-id/CA+hUKGKDe98DFWKJoS7e4Z+Oamzc-1sZfpL3V3PPgi1uNvQ1tw@mail.gmail.com
-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Proposition to use '==' as synonym for 'IS NOT DISTINCT FROM'
Next
From: Robert Haas
Date:
Subject: Re: [Proposal] Arbitrary queries in postgres_fdw