Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1le4Mt-0007o9-JM for pgsql-general@arkaria.postgresql.org; Tue, 04 May 2021 23:22:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1le4Ms-0002km-7P for pgsql-general@arkaria.postgresql.org; Tue, 04 May 2021 23:22:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1le4Mr-0002kc-Uu for pgsql-general@lists.postgresql.org; Tue, 04 May 2021 23:22:17 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1le4Mo-00088R-Qn for pgsql-general@postgresql.org; Tue, 04 May 2021 23:22:17 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1le4Mm-0003Le-MH; Tue, 04 May 2021 19:22:12 -0400 Date: Tue, 4 May 2021 19:22:12 -0400 From: Bruce Momjian To: Venkata B Nagothi Cc: pgsql-general Subject: Re: Postgres upgrade 12 - issues with OIDs Message-ID: <20210504232212.GE27412@momjian.us> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, May 5, 2021 at 07:49:29AM +1000, Venkata B Nagothi wrote: > Hi There, > > We are attempting to upgrade our Postgres databases from 9.5 to 12.5 using > pg_upgrade link mode and are facing issues with OIDs. > > ALTER TABLE... SET WITHOUT OIDs on the larger tables is taking very long and is > locking up the table as well. We do have tables of more than 1 TB of size.  > Is there any way to make this complete faster ?  Any suggestions would be > great.  Uh, I see this on our code: pg_fatal("Your installation contains tables declared WITH OIDS, which is not\n" "supported anymore. Consider removing the oid column using\n" " ALTER TABLE ... SET WITHOUT OIDS;\n" "A list of tables with the problem is in the file:\n" " %s\n\n", output_path); Uh, I don't know of any way to speed that up, though it might be faster if it was done while no one else was accessing the table. I see this comment in our PG 11 code: /* * If we dropped the OID column, must adjust pg_class.relhasoids and tell * Phase 3 to physically get rid of the column. We formerly left the * column in place physically, but this caused subtle problems. See * http://archives.postgresql.org/pgsql-hackers/2009-02/msg00363.php */ -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion.