pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: pg_upgrade: copy locale and encoding information to new cluster.
5+ messages / 3 participants
[nested] [flat]

Commits from this thread:
  2023-03-09 206b44bb24  Fix 9637badd9f.
* pgsql: pg_upgrade: copy locale and encoding information to new cluster.
@ 2023-03-09 16:40 Jeff Davis <jdavis@postgresql.org>
  2023-03-09 17:21 ` Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster. Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 1 reply; 5+ messages in thread

From: Jeff Davis @ 2023-03-09 16:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_upgrade: copy locale and encoding information to new cluster.

Previously, pg_upgrade checked that the old and new clusters were
compatible, including the locale and encoding. But the new cluster was
just created, and only template0 from the new cluster will be
preserved (template1 and postgres are both recreated during the
upgrade process).

Because template0 is not sensitive to locale or encoding, just update
the pg_database entry to be the same as template0 from the original
cluster.

This commit makes it easier to change the default initdb locale or
encoding settings without causing needless incompatibilities.

Discussion: https://postgr.es/m/d62b2874-729b-d26a-2d0a-0d64f509eca4@enterprisedb.com
Reviewed-by: Peter Eisentraut

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9637badd9f9209166140eb567602e91699dd2ffb

Modified Files
--------------
src/bin/pg_upgrade/Makefile            |   2 +
src/bin/pg_upgrade/check.c             | 160 ---------------------------------
src/bin/pg_upgrade/info.c              |  69 ++++++++++----
src/bin/pg_upgrade/meson.build         |   1 +
src/bin/pg_upgrade/pg_upgrade.c        |  62 +++++++++++++
src/bin/pg_upgrade/pg_upgrade.h        |  12 ++-
src/bin/pg_upgrade/t/002_pg_upgrade.pl |  69 +++++++++++++-
7 files changed, 192 insertions(+), 183 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster.
  2023-03-09 16:40 pgsql: pg_upgrade: copy locale and encoding information to new cluster. Jeff Davis <jdavis@postgresql.org>
@ 2023-03-09 17:21 ` Andrew Dunstan <andrew@dunslane.net>
  2023-03-09 17:35   ` Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster. Jeff Davis <pgsql@j-davis.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Andrew Dunstan @ 2023-03-09 17:21 UTC (permalink / raw)
  To: Jeff Davis <jdavis@postgresql.org>; pgsql-committers@lists.postgresql.org


On 2023-03-09 Th 11:40, Jeff Davis wrote:
> pg_upgrade: copy locale and encoding information to new cluster.
>
> Previously, pg_upgrade checked that the old and new clusters were
> compatible, including the locale and encoding. But the new cluster was
> just created, and only template0 from the new cluster will be
> preserved (template1 and postgres are both recreated during the
> upgrade process).
>
> Because template0 is not sensitive to locale or encoding, just update
> the pg_database entry to be the same as template0 from the original
> cluster.
>
> This commit makes it easier to change the default initdb locale or
> encoding settings without causing needless incompatibilities.


This looks like it broke cross version upgrade testing. Old versions 
don't have datlocprovider.


See 
<https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=crake&dt=2023-03-09%2016%3A47%3A03...;:

Performing Consistency Checks
-----------------------------
Checking cluster versions                                   ok
SQL command failed
SELECT encoding, datlocprovider,        datcollate, datctype, daticulocale FROM	pg_catalog.pg_database WHERE datname='template0'
ERROR:  column "datlocprovider" does not exist
LINE 1: SELECT encoding, datlocprovider,        datcollate, datctype...
                          ^

Failure, exiting


cheers

andrew

--
Andrew Dunstan
EDB:https://www.enterprisedb.com

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster.
  2023-03-09 16:40 pgsql: pg_upgrade: copy locale and encoding information to new cluster. Jeff Davis <jdavis@postgresql.org>
  2023-03-09 17:21 ` Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster. Andrew Dunstan <andrew@dunslane.net>
@ 2023-03-09 17:35   ` Jeff Davis <pgsql@j-davis.com>
  2023-03-09 22:21     ` Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster. Jeff Davis <pgsql@j-davis.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Jeff Davis @ 2023-03-09 17:35 UTC (permalink / raw)
  To: Andrew Dunstan <andrew@dunslane.net>; Jeff Davis <jdavis@postgresql.org>; pgsql-committers@lists.postgresql.org

On Thu, 2023-03-09 at 12:21 -0500, Andrew Dunstan wrote:
> This looks like it broke cross version upgrade testing. Old versions
> don't have datlocprovider.

Thank you, fixing. Just waiting for some CI tests.

Regards,
	Jeff Davis







^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster.
  2023-03-09 16:40 pgsql: pg_upgrade: copy locale and encoding information to new cluster. Jeff Davis <jdavis@postgresql.org>
  2023-03-09 17:21 ` Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster. Andrew Dunstan <andrew@dunslane.net>
  2023-03-09 17:35   ` Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster. Jeff Davis <pgsql@j-davis.com>
@ 2023-03-09 22:21     ` Jeff Davis <pgsql@j-davis.com>
  2023-03-09 22:30       ` Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster. Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 1 reply; 5+ messages in thread

From: Jeff Davis @ 2023-03-09 22:21 UTC (permalink / raw)
  To: Andrew Dunstan <andrew@dunslane.net>; Jeff Davis <jdavis@postgresql.org>; pgsql-committers@lists.postgresql.org

On Thu, 2023-03-09 at 09:35 -0800, Jeff Davis wrote:
> On Thu, 2023-03-09 at 12:21 -0500, Andrew Dunstan wrote:
> > This looks like it broke cross version upgrade testing. Old
> > versions
> > don't have datlocprovider.
> 
> Thank you, fixing. Just waiting for some CI tests.

I fixed most of the problems, but I'm still seeing a failure on crake:

https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=crake&dt=2023-03-09%2019%3A37%3A04...

It seems only the 94 upgrade is failing, and the message seems
unrelated to my change:

"could not load library "$libdir/uuid-ossp": ERROR:  could not access
file "$libdir/uuid-ossp": No such file or directory
In database: contrib_regression_uuid-ossp"

Is that a transient failure?

I tried locally testing the upgrades, but it seems like the version of
master before my change (8dff2f224f) also fails the pg_upgrade test for
all versions earlier than 10. I assume there are some extra steps to
make the test work for earlier versions, but I haven't looked deeply
yet.

Regards,
	Jeff Davis






^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster.
  2023-03-09 16:40 pgsql: pg_upgrade: copy locale and encoding information to new cluster. Jeff Davis <jdavis@postgresql.org>
  2023-03-09 17:21 ` Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster. Andrew Dunstan <andrew@dunslane.net>
  2023-03-09 17:35   ` Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster. Jeff Davis <pgsql@j-davis.com>
  2023-03-09 22:21     ` Re: pgsql: pg_upgrade: copy locale and encoding information to new cluster. Jeff Davis <pgsql@j-davis.com>
@ 2023-03-09 22:30       ` Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 0 replies; 5+ messages in thread

From: Andrew Dunstan @ 2023-03-09 22:30 UTC (permalink / raw)
  To: Jeff Davis <pgsql@j-davis.com>; Jeff Davis <jdavis@postgresql.org>; pgsql-committers@lists.postgresql.org


On 2023-03-09 Th 17:21, Jeff Davis wrote:
> On Thu, 2023-03-09 at 09:35 -0800, Jeff Davis wrote:
>> On Thu, 2023-03-09 at 12:21 -0500, Andrew Dunstan wrote:
>>> This looks like it broke cross version upgrade testing. Old
>>> versions
>>> don't have datlocprovider.
>> Thank you, fixing. Just waiting for some CI tests.
> I fixed most of the problems, but I'm still seeing a failure on crake:
>
> https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=crake&dt=2023-03-09%2019%3A37%3A04...
>
> It seems only the 94 upgrade is failing, and the message seems
> unrelated to my change:
>
> "could not load library "$libdir/uuid-ossp": ERROR:  could not access
> file "$libdir/uuid-ossp": No such file or directory
> In database: contrib_regression_uuid-ossp"
>
> Is that a transient failure?


I think it's a different issue, probably related to the fact that crake 
is taking meson for a walk.


cheers


andrew

--
Andrew Dunstan
EDB:https://www.enterprisedb.com

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2023-03-09 22:30 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-03-09 16:40 pgsql: pg_upgrade: copy locale and encoding information to new cluster. Jeff Davis <jdavis@postgresql.org>
2023-03-09 17:21 ` Andrew Dunstan <andrew@dunslane.net>
2023-03-09 17:35   ` Jeff Davis <pgsql@j-davis.com>
2023-03-09 22:21     ` Jeff Davis <pgsql@j-davis.com>
2023-03-09 22:30       ` Andrew Dunstan <andrew@dunslane.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox