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 1iJkif-000644-RU for pgsql-bugs@arkaria.postgresql.org; Sun, 13 Oct 2019 20:44:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iJkfg-0000Ix-Ie for pgsql-bugs@arkaria.postgresql.org; Sun, 13 Oct 2019 20:40:56 +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 1iJkdk-0000Hq-7u for pgsql-bugs@lists.postgresql.org; Sun, 13 Oct 2019 20:38:56 +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 1iJkdg-0000fk-Mm for pgsql-bugs@lists.postgresql.org; Sun, 13 Oct 2019 20:38:55 +0000 Received: by mail-wr1-x444.google.com with SMTP id b9so17336319wrs.0 for ; Sun, 13 Oct 2019 13:38:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-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=1YutUIs/jFTWvjfGXTk0jxl3Npx5S1qFnFsvPUGAIyM=; b=VTJPHypD1YLueLEPrUBHrFUbrc7eTS0Oku7v2zJhboqrpSZ+qxTYuyP1OeD/3Ffsmv Xc+92Otgn4ppHOvYcUv8Zf1gB8PKXYc1l10Hl9pbyM9ZFthRZGgROwPjz8Kh4LbexADt YAf96uDRnFMTwvF2V15hiqSIIirTB3kbWDdub5mgGlPwQyoMhKyT8hfoANv/izr1TKx4 jlOebE0solklcN8KGt5P8nRCdESDL16AbRb6RzXlyLRB3ecalOkyANIoEAKNK69+aguY BJXq6WK6VJ+rg74cRgMkNZsH/QpnlZBukOhrHHeSWaCj3lB2ZpjYgxVPmkbEsEdK7C8+ IKkQ== 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=1YutUIs/jFTWvjfGXTk0jxl3Npx5S1qFnFsvPUGAIyM=; b=eLc/3X+kENaMIjWOjeIUoCbW6562Wf9Dh4CJa58et9gtuyJhYOwYSuP+gKbO2IHCgM 2Dk3Htwgaph0/lsdVvGrCZsArgNYSAG6alxxz8hF0HZkZnhpEl2ql39oQ4PQD7jSLN/9 15H9QtNq9uafGboVCTWvQzVvWUtHLw/JMze3eY0GWEFtoHJvX8li1Lm+X/HS7tbC2/4z u/uuzNG/aDDLoOmkGkq5lfx0U6XuNEt+d3PIHnJfRRGpBGo4HaOhcpa1aAfl13frVloF IM06WMoD4gDA8GZYFI324POHuKAFj2rKdE7KXU2cnr00dAiS+KBwW746RaUS3kd+rBUf ak8A== X-Gm-Message-State: APjAAAX6lha+eU8U4iULWeAv08DWEzc1zp2B1PdOvhYK2EEveY5srf5P lOQ41zVNW2aKDY1TcwIxPTPmQfSwNgM= X-Google-Smtp-Source: APXvYqxRggHxNRRs4pKO2avHy/+GVhCFzb0en1YHD79ffQocUpZHkrCt8Fn7OWoQh4zdnoRJSr1twA== X-Received: by 2002:a5d:694e:: with SMTP id r14mr24737712wrw.232.1570999130795; Sun, 13 Oct 2019 13:38:50 -0700 (PDT) Received: from localhost (ip-86-49-253-183.net.upcbroadband.cz. [86.49.253.183]) by smtp.gmail.com with ESMTPSA id l18sm17616727wrc.18.2019.10.13.13.38.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Oct 2019 13:38:50 -0700 (PDT) Date: Sun, 13 Oct 2019 22:38:48 +0200 From: Tomas Vondra To: Tom Lane 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 Message-ID: <20191013203848.2eksimmpux3546wr@development> References: <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> <17717.1570991208@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <17717.1570991208@sss.pgh.pa.us> User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sun, Oct 13, 2019 at 02:26:48PM -0400, Tom Lane wrote: >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...) > Hmm? How could that be safe? Let's say we have a composite type with a sql_identifier column, it's used in a table with data, and we drop the column. We need the pg_type information to parse the existing, so how could we skip attisdropped columns? >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. > You mean the recursive CTE, removal of RELKIND_COMPOSITE_TYPE or the proposed change w.r.t. dropped columns? regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services