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 1tnsSU-0037MR-S3 for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Feb 2025 04:58:47 +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 1tnsSV-00DnpO-G3 for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Feb 2025 04:58:46 +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 1tnsSV-00DnpG-6X for pgsql-hackers@lists.postgresql.org; Fri, 28 Feb 2025 04:58:45 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tnsSR-0006V7-2E for pgsql-hackers@postgresql.org; Fri, 28 Feb 2025 04:58:44 +0000 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-2f44353649aso2800243a91.0 for ; Thu, 27 Feb 2025 20:58:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740718723; x=1741323523; 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=6MXOTikzaRYf4ca9DvzZtliWrppg52wCrG7233UGT3c=; b=Eakr/boS1chHAENaed9IlU1vpg6BZ0LAaStD8u1LPtBxou/K1sf06xj6pKdBjnozXb B9sKEeBdfHaioI7gZqA/4aLhUyYoA6LW4rfk327A8qjVq/7BBfymiLPgdazp/3o4RKjP 5iotMHtD0C5OsBuEh2QSsOR4XpAbfN25cgXwOyeD98RBzxH/RpsMyGpuzYNf9KwxJ3WU nyp3rTIaDtKVlTvsIRWQCCMEXZpnvlkpxWPQzVyi4HkayTi3bPhNsaZwIoPoxE28sQXa FlN5QYx/xba2gHFDRSmEu6N5xe/+u4Hv98fvwcG+EXzfH4CQS2tR6VIYKWjCwQax4H2g WkUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740718723; x=1741323523; 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=6MXOTikzaRYf4ca9DvzZtliWrppg52wCrG7233UGT3c=; b=t0WOYaOSWhNKOexiiVjewxfr0gjFRcJLmVv30jsfzAi9mUwPyr8Tfl0hcwcUV6R9eF 6vIzVA+c2kC7R6983UsPZyNi4MSSGxGBaM1aeb4fIJZ+nzVK3yOQhI+uClxOdXe4s5GY 0eLSNuMVci3IDYsN7UjfbLF8eaEYurb4ULxOwzm76khTsIS/qoSAiRrtfhO0QFXQdRwC YBi0yh9mMUEe2To/HoeLN/w2bh1xRwnNcCxlTIIjXtzgjueZuPstn6RXcflcpcDIDwdB aLbxEDTYzVUSPahbdqiK0u4w4upq4cmzMsQSFyv016he5DlRhUJkp/uV9PjC8Gey9fct SUOA== X-Forwarded-Encrypted: i=1; AJvYcCWQMYchtMz5Stlo3IHz3Z5Zf+uRtCmqF/qqS6kVc/Hn//8UBwOSCuMWBs8VYwa8EHxha+DhU/E6vdFjAgSQ@postgresql.org X-Gm-Message-State: AOJu0Yw2VLm47czD3TrExactARQklAoyB9lBvIbyHYoBLc8R5q+oeYHH 2kcVr9MFrWrFKFWBMgLd8COn1fG+O85uLnY+dxjZ9UVngS9By1G7yYWfNP9hHpcKWG9+Gal9Ehk zvI5nHxIXqqv3+47dElF7UHizTrY= X-Gm-Gg: ASbGncuiXn50w72s4sT2ngLmlJ7c1yC9OQvwKpNSOAci/wZF5oN6nN+/3z7S1pMMMD9 WHdfqGB/6l245SfVn51tzYkBSA0yvJw6Ue9X373pyLd+noMrMgL/ntmT1XSWWTQg2mUlTL+gU7Z XmqjgYm40= X-Google-Smtp-Source: AGHT+IEO9xy45iDLtPLA4t6yShTRbG/2M+qjdGlrnMAoxCK3YoXlnbGyI6PBGIQXXs3ELG5My3IhylBd9f0Chj8lpHU= X-Received: by 2002:a05:6a20:431d:b0:1f0:e2d1:bec0 with SMTP id adf61e73a8af0-1f2f4cafaf1mr3672950637.2.1740718722585; Thu, 27 Feb 2025 20:58:42 -0800 (PST) MIME-Version: 1.0 References: <202502271118.3jopzlc5yfkn@alvherre.pgsql> In-Reply-To: <202502271118.3jopzlc5yfkn@alvherre.pgsql> From: Amul Sul Date: Fri, 28 Feb 2025 10:27:58 +0530 X-Gm-Features: AQ5f1JqPoWqoIrLMFX2M95Rb3kzAvT9wZ0pKHHPVyQL_hWEgOVr-8etzuU4_anM Message-ID: Subject: Re: NOT ENFORCED constraint feature To: =?UTF-8?Q?=C3=81lvaro_Herrera?= Cc: Peter Eisentraut , Ashutosh Bapat , jian he , PostgreSQL-development , Joel Jacobson , Suraj Kharage 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, Feb 27, 2025 at 4:48=E2=80=AFPM =C3=81lvaro Herrera wrote: > > On 2025-Feb-27, Amul Sul wrote: > > > Attached is the rebased patch set against the latest master head, > > which also includes a *new* refactoring patch (0001). In this patch, > > I=E2=80=99ve re-added ATExecAlterChildConstr(), which is required for t= he main > > feature patch (0008) to handle recursion from different places while > > altering enforceability. > > I think you refer to ATExecAlterConstrEnforceability, which claims > (falsely) that it is a subroutine to ATExecAlterConstrRecurse; in > reality it is called from ATExecAlterConstraintInternal or at least > that's what I see in your 0008. So I wonder if you haven't confused > yourself here. If nothing else, that comments needs fixed. I didn't > review these patches. > Yeah, that was intentional. I wanted to avoid recursion again by hitting ATExecAlterChildConstr() at the end of ATExecAlterConstraintInternal(). Also, I realized the value doesn=E2=80=99t matter since recurse =3D false is explicitly set inside the cmdcon->alterEnforceability condition. I wasn=E2=80=99t fully satisfied wit= h how we handled the recursion decision (code design), so I=E2=80=99ll give i= t more thought. If I don=E2=80=99t find a better approach, I=E2=80=99ll add c= learer comments to explain the reasoning. Regards, Amul