Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOUHN-00082k-PE for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Jan 2017 18:57:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cOUHN-0002FL-CE for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Jan 2017 18:57:49 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cOUHM-0002DS-JK for pgsql-hackers@postgresql.org; Tue, 03 Jan 2017 18:57:48 +0000 Received: from mail-io0-x232.google.com ([2607:f8b0:4001:c06::232]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cOUHJ-0002sU-Ap for pgsql-hackers@postgresql.org; Tue, 03 Jan 2017 18:57:47 +0000 Received: by mail-io0-x232.google.com with SMTP id p42so437724392ioo.1 for ; Tue, 03 Jan 2017 10:57:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=djM7Qa/VTTT41/BU0mLsuPo4KugaxjXBbbryS1ThKFk=; b=qPh1QeFSTwFCZrlz8y3t/PnhjgDODpF+QYsAP3CQSSOl9nebMd5HJR2Q7d2w+fCdOE SgITEm+k8BguiSFByTzNdQLPnHh5+XMp/UP+4rnSml5HlWFIEk/iyqn3dLpwqTzIiYWr k2T8TOJoHQU/hTyjti6NsDaMikxswpUsOyzDt08D2FmGpjqlZJkLAOKJpUkAS2uX56sr 2gTHwj6BeaRZa/6EN3mkGyBn6Zi8kw1fcQ+MUR7YnpRoJgMT0JljbC7lpc7LKZUrKB7e Gp0hBVsgzIkcFRA+1p6hAI4N74LtmjkPBnrHQnTzFleibeoucdf4Omh110VjgnsE5Znv V6WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=djM7Qa/VTTT41/BU0mLsuPo4KugaxjXBbbryS1ThKFk=; b=LPAH4M/i0avcOcoTzJ44zCptH4whKvtc9XIoY9g4xnY+aO4lJXH6F8f9kp7RndnCu3 HKIdE1Y+J03cU1OE1hEcwld0HBIHLUcyF/48zPlQ9Oym14NvXXvqzWb232LQNWRXNmK+ yF5KdSVDoLwVAohOgWFqjIO6Myg5hxD+3Om/V2/ut18q1m2PIDMPYEcPzYgY5NXIf649 VD6s9iFX+2jXsx4Ui6x29SX9Vyks3WBdr4Vm3Si02dgVVY5BeaZa8LfE649vlSnDbfG3 7JG1hGB0PFDfwFKfKpQoINhHTZtS22WoPnNmkLGkKu1gqSXD4FiaPV1uqpqFGNrGPMaE 3gOQ== X-Gm-Message-State: AIkVDXLSm56SqiOtGmiT514F4ue4XSETXXjeiwgQh0Lqytu5F8X5YCNsX6yPrsmQfqb1Jg== X-Received: by 10.107.200.204 with SMTP id y195mr47662124iof.73.1483469864136; Tue, 03 Jan 2017 10:57:44 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id g86sm16762225iod.31.2017.01.03.10.57.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jan 2017 10:57:43 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id E9F538014DC; Tue, 3 Jan 2017 12:57:42 -0600 (CST) Date: Tue, 3 Jan 2017 12:57:42 -0600 From: Justin Pryzby To: Robert Haas Cc: "pgsql-hackers@postgresql.org" Subject: Re: ALTER TABLE .. ALTER COLUMN .. ERROR: attribute .. has wrong type Message-ID: <20170103185742.GQ32031@telsasoft.com> References: <20161012152505.GD12747@telsasoft.com> <20170102225618.GA10071@telsasoft.com> <20170103003240.GM32031@telsasoft.com> <20170103165903.GP32031@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Tue, Jan 03, 2017 at 01:40:50PM -0500, Robert Haas wrote: > On Tue, Jan 3, 2017 at 11:59 AM, Justin Pryzby wrote: > > On Tue, Jan 03, 2017 at 11:45:33AM -0500, Robert Haas wrote: > >> > ts=# begin; drop view umts_eric_ch_switch_view, eric_umts_rnc_utrancell_view, umts_eric_cell_integrity_view; ALTER TABLE eric_umts_rnc_utrancell_metrics ALTER COLUMN PMSUMPACKETLATENCY_000 TYPE BIGINT USING PMSUMPACKETLATENCY_000::BIGINT; > >> > BEGIN > >> > DROP VIEW > >> > ERROR: attribute 424 has wrong type > >> > DETAIL: Table has type smallint, but query expects integer. > >> > ts=# > >> > > > I can cause the error at will on the existing table, but I wouldn't know how to > > reproduce the problem on a new table/database. I'm guessing it has something > Just for kicks, could you try running pg_catcheck on the affected system? > > https://github.com/EnterpriseDB/pg_catcheck Neat, I hadn't heard of it before ;) The version in PGDG has the "amkeytype" issue, so I compiled, I got this: [pryzbyj@database pg_catcheck]$ ./pg_catcheck ts notice: pg_shdepend row has invalid classid "2613": not a system catalog OID row identity: dbid="16402" classid="2613" objid="1086583699" objsubid="0" refclassid="1260" refobjid="16384" deptype="o" notice: pg_shdepend row has invalid classid "2613": not a system catalog OID row identity: dbid="16402" classid="2613" objid="1086583701" objsubid="0" refclassid="1260" refobjid="16384" deptype="o" [...] notice: pg_depend row has invalid objid "1124153791": no matching entry in pg_class row identity: classid="1259" objid="1124153791" objsubid="0" refclassid="1259" refobjid="1064197368" refobjsubid="1" deptype="a" progress: done (294 inconsistencies, 0 warnings, 0 errors) .. those are the only two problem oids: [pryzbyj@database pg_catcheck]$ time ./pg_catcheck ts 2>&1 |grep -Evw '2613|1259' progress: done (264 inconsistencies, 0 warnings, 0 errors) -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers