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 1qMX6J-002d5K-7M for pgsql-admin@arkaria.postgresql.org; Thu, 20 Jul 2023 17:06:03 +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 1qMX6H-00CW6A-0V for pgsql-admin@arkaria.postgresql.org; Thu, 20 Jul 2023 17:06:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qMX6G-00CW3b-Lk for pgsql-admin@lists.postgresql.org; Thu, 20 Jul 2023 17:06:00 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qMX6C-000gfM-GI for pgsql-admin@lists.postgresql.org; Thu, 20 Jul 2023 17:05:59 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3fbc54cab6fso8505875e9.0 for ; Thu, 20 Jul 2023 10:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689872756; x=1690477556; h=content-transfer-encoding:in-reply-to:disposition-notification-to :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=PKi7VI1+T4ZPli83uyN74AjBrVCseJhTEccmK05v7bM=; b=m7gtUwB05doAx05VgKqAwqzw9UpQXBrpyCF2ZbhsAxTkjhYe+x/qrZxK2of/RfPZx9 dIEUCGVef681s8fIY7ro+bLs6DHVrgITukTo2HuxQf3aNwHgEQeFKTF/XJJJGdSqIzVm bxkgmok4HyfSkF065IPyFrenFpa2wV2+WDesvwmyRITw9RsgcUQF9VokvcbQJ7+EkZLr 6+SiUOPilh2QmpRkwXMUd0m+gy6ZpsKlg+1gd144pKu/qjDCXXsQSdWThCgEtnVQhx24 yC+hd/gla7B0/L8aWAPlL2FUo5eHrUNSIbvm3OVEUNfXeivTdG4tXQ0eP+T+QouN11IS w9Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689872756; x=1690477556; h=content-transfer-encoding:in-reply-to:disposition-notification-to :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=PKi7VI1+T4ZPli83uyN74AjBrVCseJhTEccmK05v7bM=; b=ITCgbE+hNmKUqeJVnoJ3haz2b+40PeGX5IPN3eTTEykyeSHFPYFAY/z74oiA7E9iqW xMuN9Cb1vweZWhAJUsFiy9DrQeCsgTeCBIoZTRtM/k9LEcExI9gAJiTIGkZ48LNgdrQv Elv3jkDZ7QyR0tYRR6/w1/FRg0mZ1qSq1Dg5zhV66NkVEnkGbpcyX4+alVtZfRt9OCQP sT/EvpuQXGaPgHfucMEN1chCTRZvqRsTXvu/HVzlSWfPsd3KE+kSisCIo79kjOsG31cL gY3dJUBFRFQT1/t/xSLRkTFgLtQK4IgEGGjqRvernUTr3sF0eW8jj77AGpVCPmO+J0bM RzXQ== X-Gm-Message-State: ABy/qLZKBVup4/sfhoatgTMPF4/TiD4xOgbkUQrCSNUHiVtQNlyYGEBg t4o44VG4WoEQnvgydJasVQe/Eq/Lu4Y= X-Google-Smtp-Source: APBJJlH9jWLR7Uzd3nh9JI2BXc+O/ncWTHHuizDD7eosxrgu4xJBGTFgYHeh6PLEQ4+7Xf+1ZhACBg== X-Received: by 2002:adf:f6c6:0:b0:314:6057:66b8 with SMTP id y6-20020adff6c6000000b00314605766b8mr2586128wrp.59.1689872756084; Thu, 20 Jul 2023 10:05:56 -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 h3-20020a5d4fc3000000b00314329f7d8asm1852702wrw.29.2023.07.20.10.05.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Jul 2023 10:05:55 -0700 (PDT) Message-ID: <1cb1652e-286a-077e-950d-516970ecf499@gmail.com> Date: Thu, 20 Jul 2023 19:05:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Upgrade from PG12 to PG Content-Language: nl, en-US, fr To: Scott Ribe Cc: pgsql-admin@lists.postgresql.org References: <3901e0da-819b-5b6d-bb57-c29f6d384725@gmail.com> 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 running /usr/lib/postgresql15/bin/pg_upgrade -v -p 5431 -P 5432 -k gives you in the output : ... "/usr/lib/postgresql15/bin/pg_dump" --host /pg/PG15 --port 5431 --username postgres --schema-only --quote-all-identifiers --binary-upgrade --format=custom --verbose --file="/pg/PG15/system/pg_upgrade_output.d/20230720T184333.610/dump/pg_upgrade_dump_16385.custom" 'dbname=dbname' >> "/pg/PG15/system/pg_upgrade_output.d/20230720T184333.610/log/pg_upgrade_dump_16385.log" 2>&1 ... so, yes pg_ugrade start a pg_dump session, even a pg_restore at the end, runs about 7 hours "/usr/lib/postgresql15/bin/pg_restore" --host /pg/PG15 --port 5432 --username postgres --create --exit-on-error --verbose --dbname template1 "/pg/PG15/system/pg_upgrade_output.d/20230720T184333.610/dump/pg_upgrade_dump_16385.custom" >> "/pg/PG15/system/pg_upgrade_output.d/20230720T184333.610/log/pg_upgrade_dump_16385.log" 2>&1 with a lot of lines in the logfiles  like:  pg_restore: executing BLOB 11108809 Server is a VM server, my VM has 64GB SuseSLES  attached to a SAN with SSD disk (Hp3Par) 2)vacuumlo lovacum -n =>  I have vacuumlo, running this: vacuumlo  dbname  -v postgres@dbfluxd02:/pg/data> vacuumlo  dflux -v Connected to database "dflux" Checking message_oid in fluxnaf.flux_message_content Checking payload_oid in fluxnaf.bridge_payload_content Successfully removed 0 large objects from database "dflux". and again same issues On 20/07/2023 16:51, Scott Ribe wrote: >> On Jul 20, 2023, at 7:46 AM, Jef Mortelle wrote: >> >> 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.