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 1wbc94-002huK-2U for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jun 2026 10:44:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wbc93-0067jy-2I for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jun 2026 10:44:49 +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 1wbc93-0067jq-1N for pgsql-hackers@lists.postgresql.org; Mon, 22 Jun 2026 10:44:49 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wbc91-00000001k3X-0gHW for pgsql-hackers@lists.postgresql.org; Mon, 22 Jun 2026 10:44:48 +0000 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-696bf0e7c9cso524310a12.1 for ; Mon, 22 Jun 2026 03:44:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1782125086; cv=none; d=google.com; s=arc-20240605; b=W8S6fPlYHttiveW/9d0EFZUwLyUnckoC8N6J4U65l2UtJeVvJx1vW6disPIcPg9kpX Q+wzws6a1hk0A11bthngAWz5CP5tzcAg56F1QfYVbuOqgW/MbO3M+bvh1Ljbd9X3ZCnu JZWXnZKx5bndv39Z5q8Q7eXBp42a4t0s7eOMtlx6C0/lcVhX6tl7AOvxaIpUETlnHqJ9 J31aMccWuYJd7LojwmeAUX1InWn8NyzSPiNn/q+W1JS63EIPJ4ex4Hy4wPMXFJrH9aLu FXh1V+e6s2Zq0FjY5zqeiTvg5OltqUV/SPZdrfWT/qabcaYqD8InV93FZ4vynMfuVbSW joHg== 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=0FMyGSS0UhDXL3+ArGKbyckJWBZMvf5BP5Mk5yIyeU4=; fh=sjyp6Gze/n9kUKGYIcCeg9yOkmiVnaPuvzbZZNIEIW0=; b=BRcUCgGOwQArV6ieqfm7+ma9xOVy9JKwhiDfylTO9AQhBWsjhh0s9455X9y3KByBAa eAW0w/OIErYKf3sv+iOFmQXan9nuHuKRraPjB+rMuuL60CYN1bwHcL7BLBmDN30UaKrN ssWmLbq4T6Xl8alpDSYAytXBi2a/zlnw8Sg8JOEfjBjqgZbeNR8BOsm5AEiSHMm51cNr GCNDqQXgBtqcWbLpve1weD0BGQfO4RU7mniFnsOp01I6YbPG3rjgSLkvUvSXNrwE7s0n K2pFCKLT9zv+CmBd35eC018Wh+UVk/ivw0cz8UYgWjrjVl2IefYdtgV4W7xQD1IBIEZ1 VE3g==; 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=1782125086; x=1782729886; 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=0FMyGSS0UhDXL3+ArGKbyckJWBZMvf5BP5Mk5yIyeU4=; b=TZ44aiIgBUjIDULUQLz1L4I2TouTpa8ccTLfsvNW+13AMO85B/+heT9TABZjVH+Hh/ DB4xNuOJ160QiZqk5RYD5CdbF+w80Kk5aMy89utl7Tl/IDpUVXEFqVjGj96BxsDvEw2B qhup4nXzMm0Vah806cA2GexnhK6Fa0lRA+Dqj3O90x8bZRB1bHbjat2myeCVew6OXVzN 6PiK3dAcsjFUltogGok3x6Rad3Fh1NJXgx1nUU9c/gT2bM+eYUHTQJBEHVQvOE78OIOZ HkRaVMTZlhDl3DqZHX1+OOn7dzZtcTMLn1+WFjNuuHhtB6DQw0Y//0InBwMSsxw0O1oC GSGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782125086; x=1782729886; 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=0FMyGSS0UhDXL3+ArGKbyckJWBZMvf5BP5Mk5yIyeU4=; b=SPVSLfiuVq+0HltG3V229s6NC6SMdaNtDcHC4zk+Lp5vCOLWCa93rfTGHKULzEou6V RSVq1HYP4Q5fyLTupjrkr0CZEYyUV55QfRwTdXayWvHSqzD0D37IBzaZZvXcQ5aW+EFd r6KuuGDHdm3XSSZ6KneyH5XqiXFzM5OQSYQ07i+zMLWS5t9kfCrPe5fpYgPCzSFFtk2c gEqx5eVKa2535ynYMeS/Peql+XSvcDRkEwYf93gNpyDUXJRNnlCtdrMhPWxl/++o63/A JIYyAVG5ZMdrzZksRJx6Mzcv9CqmD5VvUdDFqNJZvcwsGcwLfOlR2U9YgNvooWDhBE/T 5YLQ== X-Forwarded-Encrypted: i=1; AFNElJ/qsqVOnpCBcn8m7dikzgI99ITdrBYrzYYzBQ7NC3i9s53ggjA04sGv/DyLpVf08oivMJgzV6zHTtjokZQe@lists.postgresql.org X-Gm-Message-State: AOJu0YzXqiJlTDEmxB0d71iDUrheOanDTDDA8OclPA3WV3Kv39e2zM+3 1q1Tai9vZ8gdaY2pEhHO/M7TpbPKyF5SMT17gaUs9PB73QmfvMmWQHtVo2B6nDobUU+tK9jzA2D ekUh2CWqbFcXvWA/Cw6Ura9+/xfWoNZFMaUPp5WA= X-Gm-Gg: AfdE7cnsgE3r1I1F2x/GbrtZMPL+tc4IqMb+EjGbSqyJ+F3zmWluYk5YJNERwOu38IR Jm6MBotpjk2vbzy/4m8AsvNS9wTAa5db7f1CTCb2FdG/ue+1UvRVn3vLULUtoql5RX3Rq+igKjR MW0JD/z/ozn34uO24cK31UlwVGLwwOoIIdHbiQp2yFIzJy5ARXOmRmk1XtuECRQ72nMDh23H5fN FYTDBL2GlvOD1KP6r91pdRedeWIkfM8m+VkmKDzNqvhryvilIvVCWtMDo1oma0sHXZWfx2hOp9W u/+bveBpfQ== X-Received: by 2002:aa7:cd88:0:b0:695:d067:429e with SMTP id 4fb4d7f45d1cf-6973bb8c83amr4424154a12.10.1782125086175; Mon, 22 Jun 2026 03:44:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Pavel Borisov Date: Mon, 22 Jun 2026 14:44:33 +0400 X-Gm-Features: AVVi8Cd86ZvGpDSRGwoIhthhx9zD4B_JnxytyvfmtpYn1T7PjQ-Xow5J5fjqbFU Message-ID: Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands To: Alexander Korotkov Cc: Justin Pryzby , Dmitry Koval , Alexander Lakhin , pgsql-hackers@lists.postgresql.org, Tomas Vondra , Alvaro Herrera 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 Hi, Alexander! On Sun, 21 Jun 2026 at 16:11, Alexander Korotkov wro= te: > > On Thu, Jun 18, 2026 at 6:49=E2=80=AFPM Justin Pryzby wrote: > > On Thu, Jun 18, 2026 at 10:31:11AM +0300, Alexander Korotkov wrote: > > > Pushed with your suggestions accepted. > > > > Thanks. When I went back to test this, I merged ~25 partitions that > > were all on the same tablespace, but the merged table was created on th= e > > default tablespace. > > > > I tried again with default_tablespace set, but it was ignored. I think > > that's wrong. It's good to follow the tablespace of the parent table, > > but if it has no tablespace set, default_tablespace should be obeyed. > > See surrounding logic in DefineRelation. > > > > I see the docs say this: > > + ALTER TABLE MERGE PARTITION uses the partiti= oned > > + table itself as the template to construct the new partition. > > + The new partition will inherit the same table access method, pe= rsistence > > + type, and tablespace as the partitioned table. > > Correct, please see the attached patch, it makes > createPartitionTable() deal with tablespaces the same was as > DefineRelation() does. Thank you for working on this feature! I've looked into the last v1 patch. Does it also worth inheriting DefineRelation()'s check and error for the case if (tablespaceId =3D=3D GLOBALTABLESPACE_OID)? A brief look for default_tablespace GUC doesn't reveal a way why it could not be set to global tablespace in a session. Best regards, Pavel Borisov Supabase