Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sg0UR-00ED6B-G7 for pgsql-bugs@arkaria.postgresql.org; Mon, 19 Aug 2024 11:23:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sg0UO-001dfI-OH for pgsql-bugs@arkaria.postgresql.org; Mon, 19 Aug 2024 11:23:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sg0UO-001dfA-Fg for pgsql-bugs@lists.postgresql.org; Mon, 19 Aug 2024 11:23:57 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sg0UL-000QfM-Fm for pgsql-bugs@lists.postgresql.org; Mon, 19 Aug 2024 11:23:56 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-37196786139so2021707f8f.2 for ; Mon, 19 Aug 2024 04:23:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724066633; x=1724671433; darn=lists.postgresql.org; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=1wqJpu2hvjSOSqnXvzrS0UDH6vQAiscA8Btl/bGpDhc=; b=HqwACwQ4+DfCJtj6Un6apGmfZG6z4vqozM6tWE7okr0SRK+081SLv4MTNHqtk2yhvJ L5hncQs6G/0sPSImaTfl4iMazPecU3obgmSX8ajono/40ecRPRxwvkogtG3k4SLFGIPq P+LwdkFSXfr8Bp96at4TTv8n4RBrfcHOS62oS2bckD/YCRyxoPUG8NBhD/PR9WzT3Y+6 aBqd1czn//1mD3Tbv7mHsFAuJ/9M0CX937LDBtDfctfUluWa1V4O3Hsh5Of9tHkZDqCd wO51DB0rMf+dMH0JGmYPTu/JyGkrqTfavFZViAqtIZX0HHsNWZ9v06ww3Eb758RwBa5Z ntog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724066633; x=1724671433; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=1wqJpu2hvjSOSqnXvzrS0UDH6vQAiscA8Btl/bGpDhc=; b=rm2EbbpqVzA2LruJbScIkedeDWheCMbYyGZg9N4k5aIx8R21A6blfwGLa99zTLXM5t C4Q4d56W8Xpq2LIKL4cw0OAnqljVoZ3tOJT3B6tHFMApCzAjSparUcAEu/6Po9RUYOk5 d+KIgaY45kBU9QnmyGnFdB7Kosj3b52YBG7iQxSu65FnQm/ovKYAm9OYFkibIHRhxwP8 g/GJcD6FqhdU4W+rlUmfIJK+yARm+O3B2uZLrxFWahBLO60VLZR7MTWtjxEnboW9+Ixt LXPd0vJCkt6UQTo+Jf9mNPAym01kxz7RGaJUI5ToYW8by7880wtrD7g1uk7uDE350Xrs JvIA== X-Gm-Message-State: AOJu0YxIFkgsRc+lrt7+hfbpgAPCuu1tQH+5Kph8qkgHcMFaCo+F32EG hkRNH7o0pWZQvSOnSKaQ+h7BRZ3wZgYKfRAvmjw2+shWy7jsGZ/H X-Google-Smtp-Source: AGHT+IE+UL6RmfY4LjFCnFjC1cbR8fY8OUxKudSbxskQzs4nTQMBV6fYxxdHKo8HF9pJ+oQKfDU+kg== X-Received: by 2002:a5d:5d86:0:b0:371:a844:d331 with SMTP id ffacd0b85a97d-371a844d639mr3922380f8f.62.1724066633028; Mon, 19 Aug 2024 04:23:53 -0700 (PDT) Received: from ?IPV6:2a0c:5a83:4c09:9d00:d163:89c7:240:9897? ([2a0c:5a83:4c09:9d00:d163:89c7:240:9897]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429ed6585d1sm106381985e9.22.2024.08.19.04.23.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Aug 2024 04:23:52 -0700 (PDT) Content-Type: multipart/mixed; boundary="------------qg8YolNLHy5borK3HIabGacd" Message-ID: <332f0e30-f90a-4e47-b668-b53f649c244f@gmail.com> Date: Mon, 19 Aug 2024 13:23:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BUG #18576: Using EXPLAIN (VERBOSE) in information_schema.element_types returns ERROR: failed to find plan for To: Tom Lane , Richard Guo Cc: pgsql-bugs@lists.postgresql.org References: <18576-9feac34e132fea9e@postgresql.org> <2336091.1723137115@sss.pgh.pa.us> <2493069.1723149304@sss.pgh.pa.us> <2548861.1723174234@sss.pgh.pa.us> <2799439.1723217127@sss.pgh.pa.us> Content-Language: en-US From: Andrei Lepikhov In-Reply-To: <2799439.1723217127@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------qg8YolNLHy5borK3HIabGacd Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 9/8/2024 17:25, Tom Lane wrote: > I wrote: >> Richard Guo writes: >>> Agreed. Do you think it would be helpful to add some assertions to >>> verify the plan type? > >> I thought about that but didn't experiment with it. I wonder whether >> it'd just make the code more fragile. Still, it might be useful to >> verify that things are happening as we expect. > > After sleeping on it, I elected to add the Asserts as suggested, > except in v12 where they'd have had to look different. That's > not strictly a matter of laziness: v12's next release will be its > last, and I've been burned often enough to become very hesitant > about pushing even slightly-questionable code into an EOL release. Thanks for pushing this! But could you change this code a little bit? I reported this issue a year ago. At that time, it was triggered by the CustomScan node [1]. I haven't found the solution there [2]. Your code looks like a good tradeoff, and if you slightly change the code (like in the attachment), it allows CustomScan to survive such cases. [1] https://www.postgresql.org/message-id/3933834e-b657-4ad1-bf4e-5f3fbba7ba14%40app.fastmail.com [2] https://www.postgresql.org/message-id/0cbbd87e-1b57-4b7e-9825-19a6fb2f8670%40postgrespro.ru -- regards, Andrei Lepikhov --------------qg8YolNLHy5borK3HIabGacd Content-Type: text/plain; charset=UTF-8; name="minor_fix.diff" Content-Disposition: attachment; filename="minor_fix.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2NvbnRyaWIvTWFrZWZpbGUgYi9jb250cmliL01ha2VmaWxlCmluZGV4 IGFiZDc4MGYyNzcuLmM2OGFhN2JlMDAgMTAwNjQ0Ci0tLSBhL2NvbnRyaWIvTWFrZWZpbGUK KysrIGIvY29udHJpYi9NYWtlZmlsZQpAQCAtNiw2ICs2LDcgQEAgaW5jbHVkZSAkKHRvcF9i dWlsZGRpcikvc3JjL01ha2VmaWxlLmdsb2JhbAogCiBTVUJESVJTID0gXAogCQlhbWNoZWNr CQlcCisJCXBnX2V4dGVuc2lvbglcCiAJCWF1dGhfZGVsYXkJXAogCQlhdXRvX2V4cGxhaW4J XAogCQliYXNpY19hcmNoaXZlCVwKZGlmZiAtLWdpdCBhL3NyYy9iYWNrZW5kL3V0aWxzL2Fk dC9ydWxldXRpbHMuYyBiL3NyYy9iYWNrZW5kL3V0aWxzL2FkdC9ydWxldXRpbHMuYwppbmRl eCA0MDM5ZWUwZGY3Li4yNzI4ZTM1MTA1IDEwMDY0NAotLS0gYS9zcmMvYmFja2VuZC91dGls cy9hZHQvcnVsZXV0aWxzLmMKKysrIGIvc3JjL2JhY2tlbmQvdXRpbHMvYWR0L3J1bGV1dGls cy5jCkBAIC03OTE0LDcgKzc5MTQsOCBAQCBnZXRfbmFtZV9mb3JfdmFyX2ZpZWxkKFZhciAq dmFyLCBpbnQgZmllbGRubywKIAkJCQkJewogCQkJCQkJY2hhcgkgICAqZHVtbXlfbmFtZSA9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