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 1tezV8-00GoX1-Au for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Feb 2025 16:40:46 +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 1tezV7-00F4u6-Cr for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Feb 2025 16:40:45 +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 1tezV7-00F4ty-1P for pgsql-hackers@lists.postgresql.org; Mon, 03 Feb 2025 16:40:45 +0000 Received: from fhigh-a3-smtp.messagingengine.com ([103.168.172.154]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tezV4-002ySP-2v for pgsql-hackers@lists.postgresql.org; Mon, 03 Feb 2025 16:40:44 +0000 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.phl.internal (Postfix) with ESMTP id 867D11140226; Mon, 3 Feb 2025 11:40:42 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Mon, 03 Feb 2025 11:40:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1738600842; x=1738687242; bh=2 wTa7dkMEjITJkOjRFvI3X/AKS0nTiApzFl2Q2sd7t4=; b=R92ye0eivywEIDQR4 cVqwf/xyBuN7U+wVQVsM3x1CV3B35KmDeSEXXPEwOE9/K0p0h5cVZ+CKPbh+fYSU iJbNPDiTXkpYvoh5fDZDMO6wCK24z9ehPCfHZexzsOOBc9vdewLsox6e6JM4Rszj 8JoBODYDOmBuCKrdiOHCLQxTtc2+DDqGbOuffHt5GD8kDi00P809SPQSlzxTpu1n diSpoU3rVxMPcOKw7TBvxno1sCwHJBwtpJWH7rjPYMync3DCUSkPtE6Z0MwF3jwX fghpVqtvn0ehHMAvRZvS1ESq1Ogn9Dj1cJ1mY9SUNRBFR5593n2yQ3gue/OuOU/S HGVGg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddukedutdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttdej necuhfhrohhmpemllhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvh hhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpedvheeuffehgfeukeeufeeh hefghfeugfefudekjeevudffgeffkeegffffveegheenucffohhmrghinhepvghnthgvrh hprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdpnhgspg hrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprggvkhhorhho thhkohhvsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsh eslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepugdrkhhovhgr lhesphhoshhtghhrvghsphhrohdrrhhu X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 3 Feb 2025 11:40:33 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1738600818; bh=GRL/lvJsqUrPd895TLy6NBgWJ8JqYkugKjLSGLXNvzE=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=owlRxeJXtcul4uGVS9qjpY0SBtvnMX2J0rFChWtf7KLvD1v1XOLj/ndrMVXq4Qv4u LyxsMyXudIFhM6LU8bOaKJ7hSvsna8+cWR45FJ6Bl3edFzpriLRDUWXwKgiBcQSqld O33TlJ2BsXBIe+ya1VebM5zOnBYpg/rL24x9ZGq01ELxyfyh+1jMSPFD/ZH1lEptB6 zCuMvfyNzIIaqgpuzthKKuRRGNbM2GIhJkz0WvkSe1OaXCIfEbckFf4IW07MrgKOzJ 37sEi0l9cybWy3rPghBabA9fkyPAv1Nsoww/sv0khb3dvUcjY3ujfm07vQntwdSGkF mbcpWR6akOUpg== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 3C78E8F; Mon, 3 Feb 2025 17:40:18 +0100 (CET) Date: Mon, 3 Feb 2025 17:40:18 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Dmitry Koval Cc: Alexander Korotkov , pgsql-hackers@lists.postgresql.org Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands Message-ID: <202502031640.zem6orjmmxoz@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > --- a/src/backend/catalog/heap.c > +++ b/src/backend/catalog/heap.c > @@ -101,9 +101,6 @@ static ObjectAddress AddNewRelationType(const char *typeName, > Oid new_row_type, > Oid new_array_type); > static void RelationRemoveInheritance(Oid relid); > -static Oid StoreRelCheck(Relation rel, const char *ccname, Node *expr, > - bool is_enforced, bool is_validated, bool is_local, > - int16 inhcount, bool is_no_inherit, bool is_internal); > static void StoreConstraints(Relation rel, List *cooked_constraints, > bool is_internal); > static bool MergeWithExistingConstraint(Relation rel, const char *ccname, Node *expr, > @@ -111,7 +108,6 @@ static bool MergeWithExistingConstraint(Relation rel, const char *ccname, Node * > bool is_enforced, > bool is_initially_valid, > bool is_no_inherit); > -static void SetRelationNumChecks(Relation rel, int numchecks); I'm wary of taking some static functions and making them non-static without further analysis, because we create a kind-of API that's possible incoherent or at least incomplete and may cause trouble later. Maybe we should make some effort to construct a real interface here. For example, perhaps you don't need to expose both StoreRelCheck and SetRelationNumChecks, but instead would be better served by exposing StoreConstraints? (Though I think we need some explicit check that that function requires that the table is new and has no constraint, otherwise SetRelationNumChecks stores the wrong thing. No?) Or maybe use AddRelationNewConstraints() instead, which is an already exposed function. What I'm saying is just that we should be more watchful of what we put in our .h files. Note: I didn't actually review the patch. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/