pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Simon Windsor <simon.windsor@cornfield.me.uk>
To: pgsql-general@lists.postgresql.org
Subject: Database upgrade Pg11 to Pg12 issues
Date: Wed, 3 Feb 2021 23:25:11 +0000
Message-ID: <8e6d09bd-d992-e6da-b3bd-a32670f94fac@cornfield.me.uk> (raw)

Hi

I have upgraded many Pg databases from 9 to 10 to 11 using the Ubuntu 
pg_upgradecluster command (wrapper to pg_update) without issues, however 
today I upgraded a DB from 11 to 12.

Using the syntax

*/pg_upgradecluser -k -m upgrade 11 main/*

using the latest 12.5 binaries all appeared to work well, and for a 330G 
DB this took 2 minutes. On starting the DB using

systemctl start postgresql@12.service

the DB started, but the screen showed the default directory was 
*//var/lib/postgresql/11/main/*. Checking the open database with

/*show data_directory; */gave /*/var/lib/postgresql/12/main*/

Then using /*lsof | grep '11/main'*/ gave no files, but/*lsof | grep 
'12/main'*/ gave over 30K files, Checking the directory sizes suggests 
that 11/main is 300G and 12/main is 40G

So all appears OK, with files hard linked between 11/main and 12/main, 
and I assume the issue relates to the PGDATA/postgresql.auto.conf file 
being just copied from the original 11/main with data_directory being 
set to /var/lib/postgresql/11/main.

If I where to run /*pg_dropcluster 11 main*/ to remove the old database 
and conf files, will this destroy my running Pg12 database with hard 
linked files in 11/main and 12/main? In theory it shouldn't and files 
from 11/main and 12/main will all be under 12/main, I just have doubts.

Is there an easy way to tidy this up?

Simon


-- 
Simon Windsor

Eml: simon.windsor@cornfield.me.uk


“There is nothing in the world that some man cannot make a little worse and sell a little cheaper, and he who considers price only is that man's lawful prey.”

view thread (4+ messages)  latest in thread

Message-ID: <8e6d09bd-d992-e6da-b3bd-a32670f94fac@cornfield.me.uk>
Permalink:  ../8e6d09bd-d992-e6da-b3bd-a32670f94fac@cornfield.me.uk/
Also on:    postgresql.org/message-id/8e6d09bd-d992-e6da-b3bd-a32670f94fac@cornfield.me.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: simon.windsor@cornfield.me.uk
  Subject: Re: Database upgrade Pg11 to Pg12 issues
  In-Reply-To: <8e6d09bd-d992-e6da-b3bd-a32670f94fac@cornfield.me.uk>
  References: <8e6d09bd-d992-e6da-b3bd-a32670f94fac@cornfield.me.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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