Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qNvA0-006LEY-T0 for pgsql-admin@arkaria.postgresql.org; Mon, 24 Jul 2023 12:59:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qNv9z-00AHVt-8j for pgsql-admin@arkaria.postgresql.org; Mon, 24 Jul 2023 12:59:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qNv9y-00AHVl-UV for pgsql-admin@lists.postgresql.org; Mon, 24 Jul 2023 12:59:34 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qNv9w-001Hbn-7g for pgsql-admin@lists.postgresql.org; Mon, 24 Jul 2023 12:59:33 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-313e742a787so2679838f8f.1 for ; Mon, 24 Jul 2023 05:59:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690203571; x=1690808371; h=content-transfer-encoding:in-reply-to:disposition-notification-to :from:content-language:references:cc:to:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=AdAuF3No5OmIDHNzSaW0owy2wqfUTOXJBwRHjXXQUVg=; b=U29vJXZPtv6afeUc/PTDdlH3u+qvHgrTeyLgn0KaASNOTJHHThgNMyP+GEsXElr6jM XcMKZ4wgJeAiZp/8pJtPNK9vOh19UO3r8iyHLytWNVjR6GItXkmlkGpa8OYEto4LH+mT moKm/t//ChiJS+kupsFtMoXB5YSomfTk0aPi2APCY1KL7E9J5sYpbfmNjrx1byyTx5v2 F9zVm2rwm5Keq39tvAPlVlZOfp8gyRoLFdhwnzgH7KfKFFoHSMLEfVspYAIONcKzN+ep FnwnFyOPtvPji8zrmJ/qKAQvrdcQjZVw6Rf04OOpGYocspX9nTbbFXVe9jEjxin2UOtX m0CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690203571; x=1690808371; h=content-transfer-encoding:in-reply-to:disposition-notification-to :from:content-language:references:cc:to:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=AdAuF3No5OmIDHNzSaW0owy2wqfUTOXJBwRHjXXQUVg=; b=Yg/ioTHMliV0nBft/2yaHuv4fPSXrSAKE+XDSs6xqE+eK9gxuKXzjHkO6Vibs3PQP+ iV2ydcpH1AE9vE55SbkyOjZwGert6xtzU2+TtYNPM1SGuLBZm33YX6+6FIr1snsz6g23 HeW9YGhPAaFhGInvA6Mi4tFegJ+GvMNOjGSxu7eZs3nJ/EjMVGjIontuUMnglqLUXRlK 18/wWSOD/JIaNIVGnDM08CqXW/abKZGzCELzzDLotSopv+bYpP+nhsN64K5d0T1msWay ZMs9mcrv+IxKxpQKsVfIv5feF7rhVWcGtklS3gHLzqeCn1+vZZXpbIqzkoarQmLrzllq cqiA== X-Gm-Message-State: ABy/qLa3PqMnL8rn874buVRcsxmjxm9ibpCzcnRJtzjk+XxI9ZRQW8DQ aB1bH/MZhdWL0VqzWtNijqEX4R558zo= X-Google-Smtp-Source: APBJJlEwribyO+QXLmME74sjRYmsTTIW7GpLsmE87f1U+Q4zCe7Yj0GDcAa+HOgkGUus6RjYjU2qmA== X-Received: by 2002:a5d:53c2:0:b0:315:9ec6:7401 with SMTP id a2-20020a5d53c2000000b003159ec67401mr11496188wrw.21.1690203570485; Mon, 24 Jul 2023 05:59:30 -0700 (PDT) Received: from [10.1.1.193] (94-224-49-27.access.telenet.be. [94.224.49.27]) by smtp.gmail.com with ESMTPSA id m9-20020a5d56c9000000b00313e2abfb8dsm12988245wrw.92.2023.07.24.05.59.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Jul 2023 05:59:29 -0700 (PDT) Message-ID: Date: Mon, 24 Jul 2023 14:59:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Upgrade from PG12 to PG To: Scott Ribe Cc: pgsql-admin@lists.postgresql.org References: <3901e0da-819b-5b6d-bb57-c29f6d384725@gmail.com> <1cb1652e-286a-077e-950d-516970ecf499@gmail.com> Content-Language: nl, en-US, fr From: Jef Mortelle Disposition-Notification-To: Jef Mortelle In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello This is the syntax: export PGDATA=/pg/PG15/system export PATH=/usr/lib/postgresql15/bin:/bin:/usr/bin:/usr/local/bin export PGDATAOLD=/pg/data export PGDATANEW=/pg/PG15/system export PGBINOLD=/usr/lib/postgresql12/bin export PGBINNEW=/usr/lib/postgresql15/bin /usr/lib/postgresql15/bin/pg_upgrade -r -v -p 5431 -P 5432 -k -j 8  -r =--link Kind regards On 24/07/2023 14:52, Scott Ribe wrote: >> On Jul 24, 2023, at 12:38 AM, Jef Mortelle wrote: >> For some reason Postgres creates a new subdirectory for each PG version (I make use of tablespaces for each database in my PG cluster), also with using the link option. >> So after some upgrade, it ends in a really mess with directory's? > At the end of pg_upgrade, you can start up the old version against the old directory, or the new version against the new directory. (With --link, only until writing into the db, then you are committed to the running version.) Once you are comfortable that everything is good with the new version, you should delete the old data. Alternatively, if there is a problem forcing you back to the old version, you delete the new data. > >> => pg_dump schema_only, after RAM upgrade from 8GB up to 64GB (otherwise the query against pg_largeobject ends in a OUT of Memory error) runs in about 3-4 minutes >> => pg_restore takes 7 hours, which is 99% used for executing the query like: SELECT pg_catalog.lo_unlink('oid'); > Given the tests you've run, it seems to me that it is doing something which it ought not when using --link. > >> Database is 95GB, so not so big ;-) but have ~25miljon large objects in it. > I suppose the use of large objects here is an artifact of support for other databases which have much lower limits on varchar column length. > >