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 1iJif4-00023S-Rb for pgsql-bugs@arkaria.postgresql.org; Sun, 13 Oct 2019 18:32:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iJibU-000353-4U for pgsql-bugs@arkaria.postgresql.org; Sun, 13 Oct 2019 18:28:28 +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 1iJiZz-00034J-Kl for pgsql-bugs@lists.postgresql.org; Sun, 13 Oct 2019 18:26:55 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iJiZx-0007yJ-Fp for pgsql-bugs@lists.postgresql.org; Sun, 13 Oct 2019 18:26:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x9DIQmfd017718; Sun, 13 Oct 2019 14:26:48 -0400 From: Tom Lane To: Tomas Vondra cc: Andres Freund , buschmann@nidsa.net, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16045: vacuum_db crash and illegal memory alloc after pg_upgrade from PG11 to PG12 In-reply-to: <20191013001032.lqrn4kqaovhrf77l@development> References: <20191009230759.ge66neof5qj627a2@development> <19314.1570663125@sss.pgh.pa.us> <20191009232836.jg77wccqwy5fgs6s@development> <20265.1570664514@sss.pgh.pa.us> <20191010014813.3b2btmkakhrskwgd@alap3.anarazel.de> <20191010134303.bkwjzchjb2w66iro@development> <30706.1570717152@sss.pgh.pa.us> <20191010163350.2rtcjtje6tkgilqi@development> <1542.1570738460@sss.pgh.pa.us> <20191010204022.6hiiubm2cueu3ghk@development> <20191013001032.lqrn4kqaovhrf77l@development> Comments: In-reply-to Tomas Vondra message dated "Sun, 13 Oct 2019 02:10:32 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <17716.1570991207.1@sss.pgh.pa.us> Date: Sun, 13 Oct 2019 14:26:48 -0400 Message-ID: <17717.1570991208@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tomas Vondra writes: > here is an updated patch, with the recursive CTE. I've done a fair > amount of testing on it on older versions (up to 9.4), and it seems to > work just fine. Might be a good idea to exclude attisdropped columns in the part of the recursive query that's looking for sql_identifier columns of composite types. I'm not sure if composites can have dropped columns today, but even if they can't it seems like a wise bit of future-proofing. (We'll no doubt have occasion to use this logic again...) Looks good other than that nit. > BTW the query (including the RELKIND_COMPSITE_TYPE) was essentially just > a lightly-massaged copy of old_9_6_check_for_unknown_data_type_usage, so > that seems wrong too. Yeah, we should back-port this logic into that check too, IMO. regards, tom lane