Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iV9Wr-00021q-4l for pgsql-general@arkaria.postgresql.org; Thu, 14 Nov 2019 07:26:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iV9Wo-0000m4-CW for pgsql-general@arkaria.postgresql.org; Thu, 14 Nov 2019 07:26:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iV9Wn-0000lx-U7 for pgsql-general@lists.postgresql.org; Thu, 14 Nov 2019 07:26:54 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iV9Wk-0007nJ-W6 for pgsql-general@postgresql.org; Thu, 14 Nov 2019 07:26:53 +0000 Received: by mail-wr1-x444.google.com with SMTP id i10so5202107wrs.7 for ; Wed, 13 Nov 2019 23:26:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=TjBquoLNzzMCJ3ZjnYzgF5Tl3/N0mYuu2j+/WbxSrm4=; b=YQOVN8y6WssJdk8fzBlnkHz9sFL2kxmDKdWXjpau5EgLoLOU1spB7psE3iuM6Z0qe6 WadCMeDN1YxY7YWUje1+LTEhzfUuoDAScq9AxUdZiPEdULB9efIw0G4cRMtJ+lxHo/OD fbl4RnM8sYTx1C6RD4AqhSunofkmLpQNj5PWGrLP+W8Gx9oHAzmS2R+LMEe5g2RjYWhM qXU1R/LqwcjZ8cKxHqqAOK00RJyZkaxhcoammY8mBJ+VPaZigQxiIrUoK3klHujefrG1 3b6Sci9T7dEbM+6USj9CNJwUIdjwiBbIDzcFjzxp5if0Ju3yMA/hCySXgApM1/hzdpcG wREw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=TjBquoLNzzMCJ3ZjnYzgF5Tl3/N0mYuu2j+/WbxSrm4=; b=RFTz5Kfv9YuxQR3aK9uJNtT1S2bWPjkANuEqrQWt5KXJCOCc2mLQua/bi0Eqj9keWt FwU8cJyPK12P+G/AQnLTVSrnsBomxPX/oai03x3xDX1cmxOLuOLH/hN6bKWXyDdvVBVf uPyRRT1AaQn28L/+9SDsrM8UZoM30m+tFezKW9KNOEZ+qI89G7lOGBYUwbKUv3S9gSqw s1VljDbfKaovM0hrybQbOrlz20uwcmc7bDlmTUwDDSLcqBYqNJvrfJyh07PzdyrRuMTL OqeHT98ixukOwBn3fAHUiS7uAFOeesmRKQoGILBqdzlrs+GOuxNYERI9JKF7KiAxn9PB D0vA== X-Gm-Message-State: APjAAAXjBGaTN86SsZapEKbE+xiBPbTw3o3tOw4Q88uJKr2oXZMvC+V3 csXcsDiCmP4/4wjfJjqgEDX3CA== X-Google-Smtp-Source: APXvYqy03nS/LOQI6fmvtIoreE6OivfCErHUu0hgjP96HEE4YE6mguvNEhkmWAIYSXBeFAEA99CVaw== X-Received: by 2002:adf:f20f:: with SMTP id p15mr3126945wro.370.1573716409361; Wed, 13 Nov 2019 23:26:49 -0800 (PST) Received: from localhost.localdomain (217-149-172-116.nat.highway.telekom.at. [217.149.172.116]) by smtp.gmail.com with ESMTPSA id t187sm784603wma.16.2019.11.13.23.26.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2019 23:26:48 -0800 (PST) Message-ID: Subject: Re: root page 3 of index "pg_class_oid_index" has level 0, expected 1 From: Laurenz Albe To: Abhijit Gharami , PostgreSQL mailing lists Date: Thu, 14 Nov 2019 08:26:48 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.4 (3.32.4-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Abhijit Gharami wrote: > During major version upgrade from PostgreSQL v9.4 to v9.6 I facing following error: > > Performing Consistency Checks > ----------------------------- > Checking cluster versions ok > > connection to database failed: FATAL: root page 3 of index "pg_class_oid_index" has level 0, expected 1 > > > could not connect to old postmaster started with the command: > "/postgresql94/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "/data/directory/postgresql" -o "-p 5432 -b -c listen_addresses='' -c unix_socket_permissions=0700 -c > unix_socket_directories='/home/postgresql_user'" start > Failure, exiting > > > Again, I was trying to take the pg_dumpall of the same database cluster(PostgreSQL v9.4) and it failed with error: > pg_dump: [archiver (db)] connection to database "template1" failed: FATAL: root page 3 of index "pg_class_oid_index" has level 0, expected 1 > pg_dumpall: pg_dump failed on database "template1", exiting > > Please suggest how should I proceed with major version upgrade in this case. You are experiencing catalog corruption. Try stopping the cluster and starting it with postgres -P -D /path/to/data/dir Then connect and run REINDEX TABLE pg_catalog.pg_class; That should fix the corrupted index. If you have data corruption, you shouldn't use pg_upgrade to upgrade. pg_dumpall / psql is the way to go. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com