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.96) (envelope-from ) id 1wCoTR-002KdG-0o for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Apr 2026 00:51:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wCoTO-00Dfn5-1c for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Apr 2026 00:51:19 +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.96) (envelope-from ) id 1wCoTO-00Dfmw-0l for pgsql-hackers@lists.postgresql.org; Wed, 15 Apr 2026 00:51:19 +0000 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wCoTN-000000017mu-0TRs for pgsql-hackers@lists.postgresql.org; Wed, 15 Apr 2026 00:51:18 +0000 Received: by mail-ot1-x335.google.com with SMTP id 46e09a7af769-7d556c1a79eso8468182a34.3 for ; Tue, 14 Apr 2026 17:51:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776214275; cv=none; d=google.com; s=arc-20240605; b=G/KCJWUjVLfcjS0E+TAGlEuieouRuIEqVvRxPp15n8kzi4r8aO0I6YSZeLwBFe/rLj AmFpdVIUTlYDShpRV6aRl1m/tPDsWM6pP+E96mvoiAk5ln45h8JTaLT1h7a8oBqOu4LT XuRWHYkq+GRHNgAGXeBMYR2ZcYNYZPwI7a2wAtf8x/XHa2bxuWtl7Z2nR+K4dGSD1Z1k iKnYgKYn81Oy7noI+hdksCWkIgJJFgFd2IIHKUVpQNXv1HMwfCddVxSGNExYDThPwOtz PIHX5dxeGwi6Y0HFPoxYk7YARfR1ZcMfAN0kRQBRHB1wHWXcC5fmFbZURsNQm6369HQH m7DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=cUjEaBLtWJ6YgsktbGlXF98oarbPONgt1JvSXPdUpt4=; fh=CU/fmWZumdbVnwflKsMNynwTvDWx3gn5PrPEQQGEv9c=; b=SgxEIkkxsDBpfAfi9eRksVh6zCklApbZlMiTBh7lXJD8pi2jJ9jQUvXrnC+pWA6yY1 1XAhcjvs9V03nu95Dw28q+GJPEdEYHw4Sp/fqXywH3wiHlnjZUEJyY2kO1OPEk+HS971 LmajY2KalejvYX9bYl6Gw8oYfnthPv5Y9wrFcx1BZfX7KK6ZR7nOEKgMaoDEtsFk773z dLBmX3GBjBf1+YTG37N5FojgkgSXyq9cil9gPKgKSiI6Vc8bPtIibJXw6TubxUC36ISw lk6rhzS3bqwwwNhA2CobM/cunMZEgi6DGodEmsOx9Y+EuiS9hWi3BilGe1DYaeyhFE1o 1DAQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776214275; x=1776819075; darn=lists.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=cUjEaBLtWJ6YgsktbGlXF98oarbPONgt1JvSXPdUpt4=; b=SpEVKT/658xDFETbZESueDpY0MzXerUh+o5PLI9XYCcQ7aFBLS7gFtL33/pIg6dgIV wfBs+1jtcrdwMj2ECTaLJnVFv4Pm3QpZKnea2FIpkLOD+H7hrfhMiD7FctPUHNhX1X5h RYKcLmYYazeR5NhAMUgUCtY4SdJw+pzbAWyDrsIY4xquYGxg+T7JgZtBX8eEfSMeM5yi i5I2eCE0OaCDzHASAlIF7t30I1EJZvjb92JnTFYUTgDcnqoiK6qK2bwvXZ9i+1o9sRc8 lkmdrVvSvRXl7rbT/nRGN1v7zlsd+A45LYmyPucMTSHyverQ8BOvwazvrCwAlj0wCqpH c1QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776214275; x=1776819075; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=cUjEaBLtWJ6YgsktbGlXF98oarbPONgt1JvSXPdUpt4=; b=kpZ16Ib+e+3Nee7tO6uCR11xk+TWWElH5VG59Nsbk+ACfH02HuZdmXYPC02Bfs0gM4 eFQo6pvoEpg97kqF7NFTSP4LCk2X7i21n3w90HdH/wALMje5f5dyrLagBBzpor+5ZG06 LWn1b7qtRK9mHKAR9CC+yI4Tu0BgQSscqulnny2lI3bXtrddF8jc4NwYEnwUpgs35MFN Rj5Q5gUt+JT2l7NNssneeRzr1CcYlky6mMqE1phMNpgZqpJoQVbQaZB282JoaFl2OOJk MV16oUfI1/kizZEC7MKQOTQ67no7kpSa1+nU5xfAkku5KFo91mfexUCZ8chBU68ig/Zk KPPA== X-Gm-Message-State: AOJu0YyDLSra0T5El9J+ql8ST6Af5aa0rKZnes7X6DHngCmrKJQhDDjA VqOVW+f1zb2he7H69wn2maiO9Bf1JhfY+f/QHBW8bvcC93nk70dVqCiWLLqYLRtSqUhdcED5qiM 5z+D+8SK5hQ0TunIb0HiLnCjU/uQY090= X-Gm-Gg: AeBDievlhbSzfwD7IIVdPKc3DLo36ILd9/pduc7KpunY40VRm6tCZWkhOoep+X7rvc8 vvthDU1t0e6LwfuC+D8AZfsTJNWvc4GRqu2SF9Oj8mlrWRSZe1UcI4zWSNO92wOye2e9NpHeY8T l/k86NzgYMmqtRujbgSIGcneDcgLEyJgUAHL64EeP0GonYlkhA20wo1WBs1c0gpl4iTGb3Qof6T bb3Vcz+x40m9tm3KClMZ1BybUqEPHrzKO/4GYmjMQ6Zdga4BMN5MWN9f2UyVyFFXp9oHmmcYtjj rXyq0r9rqw== X-Received: by 2002:a05:6820:1611:b0:692:16e:4e85 with SMTP id 006d021491bc7-692016e4f9amr2242266eaf.49.1776214275518; Tue, 14 Apr 2026 17:51:15 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Richard Guo Date: Wed, 15 Apr 2026 09:51:03 +0900 X-Gm-Features: AQROBzBz17hZ8Zk9qN56yMXOM9UXdaVukR-P-DN1UNLpn5b6WjcYzMG2kT7cKz0 Message-ID: Subject: Re: var_is_nonnullable() fails to handle invalid NOT NULL constraints To: SATYANARAYANA NARLAPURAM Cc: Pg Hackers 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 Sun, Apr 12, 2026 at 6:33=E2=80=AFPM SATYANARAYANA NARLAPURAM wrote: > I tested this patch against the current HEAD (155c03ee) and it looks good= . > Build & tests: Applies cleanly, compiles without warnings, all 247 regres= sion tests > pass including the new subselect test case. Reproduced the bug before the= patch > and verified it is fixed after the patch. Thanks for testing. > Looks like it needs to perform table_open/table_close multiple times depe= nding upon > the number of output columns? I don't see it as a major concern but let o= thers comment. I don't see it as a major concern either performance-wise. table_open here is just a hash lookup and refcount increment, and table_close is just a refcount decrement. And the call only happens in NOT IN cases, and only after sublink_testexpr_is_not_nullable has already returned true. So I've committed this patch. - Richard