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 1qMV0V-002Xdo-QS for pgsql-admin@arkaria.postgresql.org; Thu, 20 Jul 2023 14:51:55 +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 1qMV0U-009aHq-1a for pgsql-admin@arkaria.postgresql.org; Thu, 20 Jul 2023 14:51:54 +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 1qMV0T-009aH1-Kd for pgsql-admin@lists.postgresql.org; Thu, 20 Jul 2023 14:51:53 +0000 Received: from mailout.easymail.ca ([64.68.200.34]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qMV0Q-000WGa-Ip for pgsql-admin@lists.postgresql.org; Thu, 20 Jul 2023 14:51:52 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id F0D0361FD4; Thu, 20 Jul 2023 14:51:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=elevated-dev.com; s=easymail; t=1689864708; bh=BKFxfzFMwRNVa177pLzuhFxl7rSsS3qtLTBtl8siglw=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=bKNvhcsEJ6ew4wivuJGtwD49yNU2mpIYpla+qbgcGy/ykB0y1jGOkD0tCw22vmk4u kt7xDThbVcQe6nrenJA7EqBhcajiGgHz5e3wdIMy1sKu2eZnnWCcp3pGWv9hOWRIKK 4Ej187riXl079kXjDleJAqgakZFCHdgVlW4tSpVDx4VCQIzpn4rX2IcSCqQ3L3ygs2 Tn08awjBLAsuEAJk+3X95V+FyCNgSpmXBCSxJqbLHRnSbv9RdfcWsopLNbiT/Mpj+T /aCwpal0D75L7F0UOE6temvWF+a8GWm4mAIDx3Quk6u3IH9PDru7PnvtHsxlaC6T8t wpgPUnzaB5jwA== X-Virus-Scanned: Debian amavisd-new at emo07-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo07-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BI-g12q44tTP; Thu, 20 Jul 2023 14:51:47 +0000 (UTC) Received: from smtpclient.apple (global79-186.pix.hs.uab.edu [164.111.79.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 7C5A16232A; Thu, 20 Jul 2023 14:51:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=elevated-dev.com; s=easymail; t=1689864707; bh=BKFxfzFMwRNVa177pLzuhFxl7rSsS3qtLTBtl8siglw=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=cFInoVSq3+sHRXJ1ltr3A9ORpIwqkpJcj/v2vgcZrr/Sf/gJdwellVVg/0q9uDjdM RqcTsUeZALB5Fm6HTxjg05xg/LcZl3Vu1Pzf0B8Bl58vF1XbCE0YVwFqie5+z67nIy BQXQEu7LYeprKksD00+TtpHaxEDPTH1F6EbruJutXCc2555f0UcKqNxifc9aLouZxo Ycyt/igAwSh3axNO+tuxSTjfTvGdW+hhDb4X4yZkU2mrSIWkdIbGTgn/WLYwD/btBA BrIndRKTdQqodXbbUiPNffexqUEyhlVi9aHMkf1waYP7TRUmsLHXiZtTRwqd5TaqJu EIR1bxn+3BtNw== Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: Upgrade from PG12 to PG From: Scott Ribe In-Reply-To: Date: Thu, 20 Jul 2023 08:51:35 -0600 Cc: pgsql-admin@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <3901e0da-819b-5b6d-bb57-c29f6d384725@gmail.com> To: Jef Mortelle X-Mailer: Apple Mail (2.3731.600.7) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Jul 20, 2023, at 7:46 AM, Jef Mortelle = wrote: >=20 > So: not possible to have very little downtime if you have a database = with al lot rows containing text as datatype, as pg_upgrade needs 12hr = for 24 milj rows in pg_largeobject. We need to get terminology straight, as at the moment your posts are = very confusing. In PostgreSQL large objects and text are not the same. = Text is basically varchar without a specified length limit. Large object = is a blob (but not what SQL calls a BLOB)--it is kind of like a file = stored outside the normal table mechanism, and provides facilities for = partial reads, etc: = https://www.postgresql.org/docs/15/largeobjects.html. There are a number = of ways to wind up with references to large objects all deleted, but the = orphaned large objects still in the database. First thing you should do: run lovacuum -n to find out if you have = orphaned large objects. If so, start cleaning those up, then see how = long pg_upgrade takes. Second, what's your hardware? I really don't see dump & restore of a 1TB = database taking 6 hours. > Alsready tried to use --link and --jobs, but you cannot ommit the = "select lo_unlink ...." for every rows containing datatype text in = your database that the pg_* program creates in the export/dump file. Terminology again, or are you conflating two different issues? = pg_upgrade --link does not create a dump file.=