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 1wFV8F-005DBa-01 for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Apr 2026 10:48:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wFV8E-00D0VH-09 for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Apr 2026 10:48:34 +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 1wFV8D-00D0V6-1n for pgsql-hackers@lists.postgresql.org; Wed, 22 Apr 2026 10:48:33 +0000 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wFV8B-00000002Elz-23sm for pgsql-hackers@postgresql.org; Wed, 22 Apr 2026 10:48:32 +0000 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-8cb38e86cf2so497424985a.1 for ; Wed, 22 Apr 2026 03:48:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776854911; cv=none; d=google.com; s=arc-20240605; b=celCJUxGBKLYrESAPXnNSa61Lu47MgFD/lx/dHSlGHBZqsNnyZD3I2bthMGCmV0zG6 DtBxyvdu99WKRpqRYHxPlm3J6kVPYvhj5aSA80iNbMjwZfq1FMcMTk0v+dLgPQCOJwlh FmkHFUJ7eMMn1NlUciYpSvWBF/BtVOcKBt5chNJjvhEQwWk1Mjg2kZpKK+o/Lya73Wuz 6ueKbpPBl7IHI+su8VmyEeWfQSIb6G1Ne27TJOJmOExlc68+IREJIaWtfzmy1AWokHe3 FPJ/8NGFBpZk55UYv+erVTNiMgb0I6hKKL4/1Si/fi4ptzwr4iP4iFutYrFfEcr1Ln/k qOrg== 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=6EtNKyeUw8ASO5EkYXHTHqB9y+XBOc1iTQ8Z6batnOo=; fh=gaBmZaZWyJNwtoAX7nFTFRCBANmQyAlJtFG/Si8PAGI=; b=fWgqMWnogbKVa1WSnEFAnrARnAJRhrXEUYL69+Hwt57Iy4OLAyMxW6+dm7pqYPhyla JPKsSCAFnahYAeu25xvpEg1YlVCY9GWn9ymIdixf7eXHOHbZcLtiVePyQPTveHEiajrl PTBdJOLOTEHgEi7it9F6NIrN0wSpC4rqrTXH42X++OCAhh9u7tMtWXRMKJ+PCxgZb4ML zJHhFBepwWu5h75xOUjET8McrBuXabQQoIJ6qU/ZJvRvo+nMmgZDW/nIRRYPqxhWP8e8 oRAowoRfXW/ny0rbwnqYnUK3cxgxLC73Ox7mjrQYTKUiUX/3QEhrNIvovtWbM22KJw2x /D5g==; darn=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=1776854911; x=1777459711; 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=6EtNKyeUw8ASO5EkYXHTHqB9y+XBOc1iTQ8Z6batnOo=; b=WdtDM+FcFypFupCW+/2MHDOLYzciGTGn9+nB6tEbSnwDMCELsTSm42wid/rD8SHCGY uSEAHJgMCRxPbXER48BfpI2BBZheno+vcUXzghIgQL3kQu1Z/1LBLjxH1XHFIUVf12Hx akCiFrjuxlZS1oCkwsWXLkNYrYwDaY/Jiqs3UztF/97t03GPQBPZkVDagrB07Un5/ktd Y4UioQPjRG3tZK4k+oxqWko5x0RrizowdzPLK14GQr9jb/vx6cssOxoR5mcORlVVxyoA yXuJv+7A6Sh/s2IFUlEM+fEcy6MZAcmCN0xpKgjOgb6R8XHBai5XhE+H4fdWjrXe+vWp J5ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776854911; x=1777459711; 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=6EtNKyeUw8ASO5EkYXHTHqB9y+XBOc1iTQ8Z6batnOo=; b=j15xGrVAs1+RZdZ6y/1Pea6dkv/5wdNCEUNIQ5e2xdUTwYs4zug95IokGpBBcPUzZO wME8nxn9B4auHOyyxogZNEF14Q+fazi22I9M9wk1ooqI4Vq8TE5H/MMU3xWY2wf+lK0q oaPsJ5yDrls20oa2JRNvvVTjQEfuYHOJPYrtccAq/1q8FNkWd4Vilrv+eDNai3egrEUg eqzuFDMxZPtUrR+VdByk68+XLXAV+cf1pOAQruw5CVCo+ny4mqmBwH3pLmb17GSfgK42 +WswKcI08zriDcIBCWoAZ+TYqWoTRRUgF1YntYYFwLbKuv42QcGq4JOipzBWelez1hsz fEcg== X-Forwarded-Encrypted: i=1; AFNElJ+2GQOaNiRWImTggvLY9v/1o2mvarDdN3spECmz21dGIS91Lub3RV6HVVQrRTyy3QeKGfoVtMCdo8cS+Hkk@postgresql.org X-Gm-Message-State: AOJu0YxY+XXrVJZKr+Q7YAChrp3dKcaJz4GC6RwQP4Ae+vcdX3bsGl+V PEGpKEzriaZX+Vb6WBnQ7Lr4CnGB6KBKAyLu9C2NwLwMLZ8dVCceR6v9BSBWs43+H6Xsq5IK+7/ i8NX33BIfDtLT0WvPd/kOhrRN7Uqx4do= X-Gm-Gg: AeBDievP33NkTsXnovvPmfJZJikcISP7liPY26XWCgM16LoLbrQ4scNd11F57zcVGQS IbEHdPPVweS9EbtDv2ufj0w51TlVRDp1SXtTnyIAm+fb6IshnHSJ7RUcro+PdwvvIujKrNl6meY NbWLgLOh8r24QdN4cfSUTmizeUkqk5miEWs9Oy47/HMmbhHaLS5rf1lEMdsBY3aIn4P7RhZo/ke Ve2ncCQJ6NZtUJYI/hOHg3QiUd+9jWj6RqySzBkfle07/WNyE17TYvGGPi3yvx6aGh+w0AMfHv7 1dCULgq15oAWCGeBULCFYrKMRj/Abucw+M7xS09+XwYElt8KVpnxSXwJKxo+y+FNf9bUaRxA6DH d37A+pfpZUYyWvO4= X-Received: by 2002:a05:620a:44cb:b0:8ef:ca26:dce4 with SMTP id af79cd13be357-8efca26e05amr293464485a.7.1776854910896; Wed, 22 Apr 2026 03:48:30 -0700 (PDT) MIME-Version: 1.0 References: <31d04a1b-c0cb-4e6f-a344-0db048a3b673@gmail.com> <414c3430-77a9-438e-9dc0-c66033f6be63@postgrespro.ru> <271ebb35-8d8f-41c3-9d95-5c1e5b416216@gmail.com> In-Reply-To: From: Kirill Reshke Date: Wed, 22 Apr 2026 15:48:18 +0500 X-Gm-Features: AQROBzB0DtjAhNFI87zWS0t9fLCuCqnHGTXSUIjCsSwc1xcM-Yos4sDInRBMYzc Message-ID: Subject: Re: MERGE PARTITIONS and DEPENDS ON EXTENSION. To: Alexander Korotkov Cc: Matheus Alcantara , Dmitry Koval , pgsql-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 Wed, 22 Apr 2026 at 00:35, Alexander Korotkov wro= te: > > On Tue, Apr 21, 2026 at 10:23=E2=80=AFPM Matheus Alcantara > wrote: > > On 21/04/26 12:57, Alexander Korotkov wrote: > > > I've spotted the following things in this patch. > > > 1) The equality of dependencies is not fully checked. We only check > > > that for each new dependency, we have the same for previous partition= , > > > but not vise versa. > > > 2) The complexity of dependency checking is O(n^2). > > > 3) Usage of citext and other extensions in src/test/regress where the= y > > > might be not available. > > > > > > > Oops, I forgot to replace the citext extension on split partition tests= . > > > > > I've revised the patch. > > > 1) collectPartitionIndexExtDeps() is rewritten(). Now it works in > > > three phases: collect, sort, compare. The comparison phase requires > > > strict equivalence of dependencies and doesn't depend on the order. > > > The complexity is now O(n * log(n)), which I think is acceptable. > > > 2) PartitionIndexExtDepEntry struct now have indexOid. So, on > > > conflict error contains both partition index names. > > > 3) Tests moved to > > > src/test/modules/test_extensions/sql/test_extdepend.sql where > > > test_ext3/test_ext5 extensions are available. > > > 4) More tests for different scenarios. > > > > > > Could you, please, review this changes? > > > > > > > I think that you miss to include the patch? > > Yep, here it is. > > ------ > Regards, > Alexander Korotkov > Supabase Hi! So, we only transfer dependencies on partitioned indexes when SPLIT/MERGE partitions, not tables themselves (this is what this thread started from). I think this is correct. Some minor comments: > +-- Sanity check: the extension can't be dropped while dependencies exist= . >+DROP EXTENSION test_ext3; This exercises something that already works on HEAD (note this is DROP before first MERGE partition call ). Do we really need this? > > +-- An index created directly on a partition has no parent in the partiti= oned > +-- index tree; merge must ignore such indexes (they disappear with the o= ld > +-- partition). > +CREATE INDEX part_extdep_3_extra_idx ON part_extdep_3(x); > +ALTER TABLE part_extdep MERGE PARTITIONS (part_extdep_merged, part_extde= p_3) > + INTO part_extdep_merged2; > +SELECT relname FROM pg_class > +WHERE relname LIKE 'part_extdep_merged2%idx' ORDER BY relname; Looks like this test is also redundant? This does not test new DEPENDS ON l= ogic. Otherwise LGTM --=20 Best regards, Kirill Reshke