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 1wut1c-000yGg-0x for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Aug 2026 14:36:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wut1a-001EfW-0d for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Aug 2026 14:36:47 +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.96) (envelope-from ) id 1wut1Z-001EfN-2U for pgsql-hackers@lists.postgresql.org; Fri, 14 Aug 2026 14:36:47 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wut1Z-00000000c6p-0Zve for pgsql-hackers@postgresql.org; Fri, 14 Aug 2026 14:36:46 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-c197e7e4e94so195360366b.2 for ; Fri, 14 Aug 2026 07:36:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786718203; x=1787323003; darn=postgresql.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=VRpBmnCrA7lonnEMANbtWIDysQ0eVRbdoBFDLpz/sqY=; b=dFr+Y7s2FYncY4zy5cuEHHwYKwicsKEo48rPwsUHFrYV+1ztmoKnUlu/T871n/Si4E AxYRSM3mf4RIJLcAD6W1Zc382cPr++kv3UjQUOZH8BYys/8svBDoMIzTN8qHAKDW9Ghv Rx3bEfNaZEehCK69jN79S+nmyoGDS11otmeSW7SCm7azEIz97Co69gb/KIzTqBvmHRm3 og4Y+A3PwvLCOs3BSXqbUVGc9mohBfOXEc9EMz/LvTPqpAMAhQ1s0BkqeaV/TqX7EfE4 g8OYF6qMIxAYvUKnpcaz21ok8NrC368NH5By8aO6Z+9tpGkuqoh8YZOIL57xxEB9r7ZA QUUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786718203; x=1787323003; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=VRpBmnCrA7lonnEMANbtWIDysQ0eVRbdoBFDLpz/sqY=; b=XC7zalafEUZXIClGlqAzqXSWzR3kEVDYiCWzxBfJFwDujzzz7hM5VZF8Rf1/F9FAke hC9zM6DwUJIyXzd6LwZLUwAWVK2tvs8BHHUGEJYS4iN3FhsI/RKqP/wUuH5prkpfQ19J UP21+YM+dCs4l72e5QRkyTu6ucpflxjgmJyDjrcMLRG3aQUMr8Lz62tm4KSvBnsnjlIe vu+Q6bG6aA1paToBDIL5grfPhTn13kjFAF272KxeOpmXxrhhCrKxbzFySN9KIdT0EaIV 70uRn9tQd5J1Y26Kwu7aS3sKxr+/Z637z/gcX/OqI+BG4smm4PZ3quA4WwHj2Vh/MmHq 9XIg== X-Forwarded-Encrypted: i=1; AHgh+RrFZjvRaxNyJfpY66rRsZsuQRov91cMSvyh4NLQ8/hRXjMb6fysK6vgA8fL6wdQjBnAn2qgDL430xl9vhCD@postgresql.org X-Gm-Message-State: AOJu0YxWPJgIqAS5ceMF+v9C1Bn9i8KqLeOv7ASYWQVM19YNZGqfaWxa T8sn1p/ymukCgJsF4ZdeuWou4LytZubahu6t7QSWbH1Qlp5FDrk729SD X-Gm-Gg: AR+sD10jBqQEejUaYpoXiAUIQYqISzlo2qY4WUkjPSnxx7DjIKZBfyGvzEkR7R0Zujy uc77tdA1UzW0v8lxrQo6R4qqhsNt0L2XDQV4aWQKvaN7eN8/Hxljr/UnKFXMXoUI54w6287fAg5 X2HABgfnew4FTXUdMmsM6zoeI311yT9PWH5y0ygqPz4yqp9Vg9zUhhrcU0WHk3gw1sv7VKIfrbM uhEZitnCnaFZN3wsfOyJg3uwbIAJxUxTdEeRIfNALPfdi68FvOss1OYrGXdfaC+EaIDUo6HaBq7 ab/lzszOm9xf7ZO+DeVV4j0Kw0qH0pf5v3iwpL0zOHeNXFAkI3vjsgJa6aALL5+2Q/3OPSI53bX mOua7+ysw8nFNnVkXnkEUmqgiluf0KW/fghVOgoXupdHP0V6hIiJQsm6W5/lTuIHlRBCoLDaBON rqcp478O7vltyEBUk6/USwpjNudvQbfRGn1onTbvAHKkUTnSdm2pS4sY9EYH+4ttEC4TzKGxSoU umz4XvXhrwy3NG/epaBPskOhG3GkFS/5ykL/HWdqV8aG1OEb9AECObelybI5YDwvuh/efCUVVw9 elqutE1O6L3HRU4= X-Received: by 2002:a17:907:3cc4:b0:c20:6d47:34ee with SMTP id a640c23a62f3a-c212a0936a6mr262739966b.7.1786718203217; Fri, 14 Aug 2026 07:36:43 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c21238700aesm105265466b.63.2026.08.14.07.36.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2026 07:36:42 -0700 (PDT) Date: Fri, 14 Aug 2026 09:36:37 -0500 From: Nathan Bossart To: Melanie Plageman Cc: Alexander Korotkov , Zsolt Parragi , pgsql-hackers , jian he Subject: Re: MERGE/SPLIT PARTITIONS issues/questions Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Aug 12, 2026 at 04:48:36PM -0400, Melanie Plageman wrote: >> > 5. In (2) I mentioned replication-related inheritance questions, but >> > it is much more generic than that, many partition specific details get >> > lost silently: >> > * indexes >> > * constraints >> > * different DEFAULTs >> > * foreign keys >> > * triggers >> > * reloptions >> > * custom tablespace >> > * table AM >> > * per column settings >> > * security labels >> > * ACLs >> > * RLS policies >> > >> > Shouldn't most of these copied into split partitions, and handled >> > properly in merges (erroring out in non trivial cases?) >> > >> > Silently dropping them doesn't seem like a good behavior, as it can >> > cause many different issues: >> > * dropping foreign keys / checks can cause data integrity issues >> > * dropping partition specific sequences can cause later inserts to >> > fail or silently fall back to nulls/different values >> > * probably many other scenarios I didn't think of >> >> This was intended to keep patches simple enough for pg 19. That's >> documented that we copy properties from parent, but don't copy from >> previous partitions(s) [1][2]. We may implement other options in >> further releases. > > I'm worried that despite the documentation, users might find this > surprising -- and by the time they realize it happened, it might be > too late. > > [...] > > The user needs to add RLS to the new leaf partitions if they want the > same level of security, but I'm not sure that's intuitive. > > Also, for merging partitions, if you merge two partitions that have > the same RLS, after merging, the new merged partition doesn't have > that RLS policy -- that seems confusing too +1. I'm looking at the current form of the documentation: It is the user's responsibility to setup ACL on the new partition. Does this mean that the merged partition is accessible to PUBLIC at first? Or that it's not accessible to anyone? I think this could be explained in greater detail. Constraints, column defaults, column generation expressions, identity columns, indexes, and triggers are copied from the partitioned table to the new partition. But extended statistics, security policies, etc, won't be copied from the partitioned table. I think the "etc" is doing a lot of heavy lifting here. Does this mean that only the things in the first list are handled, and everything else is not? When partitions are merged, any objects depending on this partition, such as constraints, triggers, extended statistics, etc, will be dropped. Which partition does "this partition" refer to? Eventually, we will drop all the merged partitions (using RESTRICT mode) too; therefore, if any objects are still dependent on them, ALTER TABLE MERGE PARTITION would fail. I think this would be clearer if we had specific terms for the partitions involved. For example, we could call the partitions that are getting merged "source partitions", and the result of the merge the "merged partition" or "destination partition". To me, the above sentence sounds like we are dropping the destination/merged partition, but I'm pretty sure that's not what it means. Much of the above applies to SPLIT PARTITION as well. I'm sympathetic to the idea of keeping things restricted at first to make the project more feasible, but this is a pretty lengthy set of limitations that IMHO deserves more prominence in the documentation (maybe even a warning). I think it'd also be a good idea to call out that these limitations by go away in future releases. I haven't looked at the patches, but the size of the patches, and the fact there there are apparently still rather large problems, does make me somewhat concerned about this feature's readiness for v19. -- nathan