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 1tJ1O2-000Uhj-FQ for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Dec 2024 02:14:38 +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 1tJ1Nz-003vtH-Vt for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Dec 2024 02:14:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tJ1Nz-003vt9-Mc for pgsql-hackers@lists.postgresql.org; Thu, 05 Dec 2024 02:14:36 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tJ1Nu-0016Rz-D5 for pgsql-hackers@postgresql.org; Thu, 05 Dec 2024 02:14:35 +0000 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-2ee989553c1so387235a91.3 for ; Wed, 04 Dec 2024 18:14:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733364869; x=1733969669; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=cIYqjDb6fS7nq2P5sgP0P53oW3eBfAvW1AqWxi1HZNs=; b=JJbv/XH4s1RBlDQiaNrJjOZWbCVT8oR3cxTlNfVfCdKjcTBNwmy4HMv8sVDnWW+mNk hiTDNC/I1AgnyOL90fxGQpsPrHc1jSVlUOxYOHuBksOquhUJqH7sqjGMSdnVXGOT9NV4 OGQXuj8gSswASe8/0iTxq9Mdxky2LIyDb1vVGWXcP3M5RUd5Zfr2vSq1YzYS4bodxjGV rqCn9L/xjT4shwtV6l6LhBwTGmsZiXnCVKhRcn8nYZ/spKVlalypZ4zJaFWzqOko/7Ry D1kljBA1eRFf0y8UAamHJHp4Sg8HTuYHNHGr9gQZHUsdUTzGXJz1aVvXJVdIaijockQI 9nNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733364869; x=1733969669; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cIYqjDb6fS7nq2P5sgP0P53oW3eBfAvW1AqWxi1HZNs=; b=k9vSUyCNbjU503c/rBwTBJseYGYEC8wp5GYk//jcur9ci+rCiWxU1nu9pHExHY397b VhPLLbbcR1w2aFuXYo9mTceD+4c0GqwV47wOkXqJ7ZXlShau4P4yCS4U2csk0jpyF34y P20V94SXcyFDh3Umjyz3dWEx7I50Nksr9NMpVykGDE7SjPPIq8WBhWXEPyO1sadWxksa OPcmij/0PXcG4R4KatyOWwDOT5ytWcM6r0JdfsW+jaIaBZQVIT0ZyXFRo/W3nODZZibf XFmOkHT1IAv5075MBWTaBQ7L51BgnCqHcmCWSKgJ9fZYDp16yVPtms81kEpD0akEFsP8 /j1w== X-Forwarded-Encrypted: i=1; AJvYcCUOAN6X/8DMeq90FwioTiq5EQI03HMtXdlxhnoKX5ho948kO+c35tzHzHWQfHmnTPIo8+7EuQknK5Ysk6NC@postgresql.org X-Gm-Message-State: AOJu0YxIfHbtcKWbqHDedjWWMBJvY3Fgv9gJDmWlXdXDfB6UuazeWK8K AoPlHhNb48LSOM9hTUI5YgEtTfBTeJKygB5+mD/uf78TbpTeemu1F7PXv+Ddti/zSMYEdJyttni qyiuLGmCuTqhUYoYM/jndIsbrvgU= X-Gm-Gg: ASbGncuuLfr/TRInhvIfv5HbOFx2pI1glaf8I4i6Xm7LsDhcQHdmwGUOjf5QBTfDbI+ Wzso+P89bf15B9XKoFVI3LRhEvSCLe5Vq X-Google-Smtp-Source: AGHT+IFSgPUBqdM0JSJALy9bJh44EvqoOmyI1q+BNm2NhIJev6Oti6KkKBrHZYX8QBeooKDLdw8uS0CIKwFzhzUB0/k= X-Received: by 2002:a17:90b:1a8e:b0:2ee:d797:40a4 with SMTP id 98e67ed59e1d1-2ef011e3ff7mr13267294a91.8.1733364868771; Wed, 04 Dec 2024 18:14:28 -0800 (PST) MIME-Version: 1.0 References: <54c35fb9-da3a-4754-ab8c-46ed0b612465@vondra.me> <684c70d7-180e-461d-9377-600c2db581ba@vondra.me> <2369348.1733333533@sss.pgh.pa.us> In-Reply-To: <2369348.1733333533@sss.pgh.pa.us> From: Amit Langote Date: Thu, 5 Dec 2024 11:14:12 +0900 Message-ID: Subject: Re: generic plans and "initial" pruning To: Tom Lane Cc: Tomas Vondra , Robert Haas , Alvaro Herrera , Andres Freund , Daniel Gustafsson , David Rowley , PostgreSQL Hackers , Thom Brown Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Dec 5, 2024 at 2:32=E2=80=AFAM Tom Lane wrote: > Tomas Vondra writes: > > I'm not forcing you to do elog, if you think ereport() is better. I'm > > only asking because AFAIK the "policy" is that ereport is for cases tha= t > > think can happen (and thus get translated), while elog(ERROR) is for > > cases that we believe shouldn't happen. > > The proposed coding looks fine from that perspective, because it uses > errmsg_internal and errdetail_internal which don't give rise to > translatable strings. Having said that, if we think this is a > "can't happen" case then it's fair to wonder why go to such lengths > to format it prettily. Also, I'd argue that the error message > style guidelines still apply, but this errdetail doesn't conform. Thinking about this further, perhaps an Assert is sufficient here. An Append/MergeAppend node's part_prune_index not pointing to the correct entry in the global "flat" list of PartitionPruneInfos would indicate a bug. It seems unlikely that user actions could cause this issue. --=20 Thanks, Amit Langote