Re: Upgrading to v12

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Brad White <b55white(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Upgrading to v12
Date: 2022-11-11 21:02:58
Message-ID: ec6d3d2e-18f7-db89-c269-b5f28cfe0183@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/11/22 12:43, Brad White wrote:
> I'm upgrading from v9.4 to v12.10 as a half step to 15.
>
> Q1: How do I tell it which database to upgrade?
> I only need the primary.
> Not the half dozen restored copies.
> Or do I need to detach everything I don't want copied?

1) If you are using pg_upgrade then it only works on the entire cluster
not individual databases.

2) This is not SQLite there is no detaching of databases.

3) I you want to move a single database then you are looking at
pg_dump/pg_restore or logical replication.

>
> Q2: I get this error, and then at the end, it says "No error."

What was the complete pg_upgrade command you used?

>
> Performing Consistency Checks
> -----------------------------
> Checking cluster versions                                   ok
> SQL command failed
> WITH regular_heap (reloid, indtable, toastheap) AS (   SELECT c.oid,
> 0::oid, 0::oid   FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace
> n          ON c.relnamespace = n.oid   WHERE relkind IN ('r', 'm') AND
>   ((n.nspname !~ '^pg_temp_' AND       n.nspname !~ '^pg_toast_temp_'
> AND       n.nspname NOT IN ('pg_catalog', 'information_schema',
>                 'binary_upgrade', 'pg_toast') AND       c.oid >=
> 16384::pg_catalog.oid) OR      (n.nspname = 'pg_catalog' AND
> relname IN ('pg_largeobject') ))),   toast_heap (reloid, indtable,
> toastheap) AS (   SELECT c.reltoastrelid, 0::oid, c.oid   FROM
> regular_heap JOIN pg_catalog.pg_class c       ON regular_heap.reloid =
> c.oid   WHERE c.reltoastrelid != 0),   all_index (reloid, indtable,
> toastheap) AS (   SELECT indexrelid, indrelid, 0::oid   FROM
> pg_catalog.pg_index   WHERE indisvalid AND indisready     AND indrelid
> IN         (SELECT reloid FROM regular_heap          UNION ALL
>  SELECT reloid FROM toast_heap)) SELECT all_rels.*, n.nspname,
> c.relname,   c.relfilenode, c.reltablespace,
> pg_catalog.pg_tablespace_location(t.oid) AS spclocation FROM (SELECT *
> FROM regular_heap       UNION ALL       SELECT * FROM toast_heap
> UNION ALL       SELECT * FROM all_index) all_rels   JOIN
> pg_catalog.pg_class c       ON all_rels.reloid = c.oid   JOIN
> pg_catalog.pg_namespace n      ON c.relnamespace = n.oid   LEFT OUTER
> JOIN pg_catalog.pg_tablespace t      ON c.reltablespace = t.oid ORDER BY 1;
> ERROR:  could not access status of transaction 22316920
> DETAIL:  Could not read from file "pg_clog/0015" at offset 73728: No error.

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Brad White 2022-11-11 21:05:37 Re: Upgrading to v12
Previous Message Ron 2022-11-11 20:50:14 Re: Setting up replication on Windows, v9.4