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 1rut68-008I3y-QB for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Apr 2024 12:00:09 +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 1rut67-00H93D-WE for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Apr 2024 12:00:08 +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 1rut67-00H933-Ik for pgsql-hackers@lists.postgresql.org; Thu, 11 Apr 2024 12:00:07 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rut65-002LG9-1p for pgsql-hackers@lists.postgresql.org; Thu, 11 Apr 2024 12:00:06 +0000 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-516cdb21b34so9939041e87.1 for ; Thu, 11 Apr 2024 05:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712836803; x=1713441603; darn=lists.postgresql.org; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=GsVJfj0pvvGkfzxbdq7wacue3ndnvBUTQkrjOkUiB3I=; b=ZcA5fv7ql7n6n/YlGDGQRE4KhcUzqBplVFJDnsfHY7lSA8wTMM9lPDWKZeIiz8FFhw 9vAysYZZ1gao3l96w1WatUYOdZsDmNEGsLucbWJp6ZQFjmgEyt0z3T//cF5MnYYzGvy4 9gT7YoprfCwdcc8NYKXeCuh7+S67GuJr3A75xY4LKJfmqio2ZUF3F9pQ7V+ETo1mKFhh izpltDNhgk+i2Ouvpwin66+ol3Rsu6rbDrF5GKI1vauI7wbgRrTNKT8d3WZWNLxJlic8 vkCA8XN2XGWoGCFUoO56szSHHWdxWWFqXJPi9Ag/2Ale4+0VLWnrBQRKLDtKHUzMNekX qc5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712836803; x=1713441603; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=GsVJfj0pvvGkfzxbdq7wacue3ndnvBUTQkrjOkUiB3I=; b=q5l3FPqqV7UXcdz307X/P5Y73SGg3iJ8eNphnAxPGq023zMSUd42HPFzhj+DUNC8Ev dEv7Hn+tJcD4x2x1yivFdpPKgn3sgl53m8ndos10+Fq6c2pT7i3Kx/vhLU8Wl99ndTjY QxMCy8xNWocEmS7BtrVHH7BJJpMKF96owztNVIA+vtssbLb2CtQQoXZQlxEId9NdCAAP 9982vYh4oSTUwanLMeXaZWw9Gmev0Qsu5lVQNtpeFp0twtEfwuLPk7uUZ0+duApVY5vT t/fi/3J+ChLFJ6QK7UHCV5GTHo2GWbSK3oc4NFg8SdQRQhPtVzjQcKYjGgsqG7Yssitg 8kYQ== X-Forwarded-Encrypted: i=1; AJvYcCVOXOI0IOuwOvoIyM3iKIp+S00l7LVnITIQuSNl2xAB5a09v1+vNpR9+ls0+ARhzqCwRXC77UBahbtLO2nS5jXLcXnZD3WIHk8MhjrK5hMmwMqD X-Gm-Message-State: AOJu0YxhQg1lNe+C5IKIJHZSPljtRZNqAmasl1SLguLTG3xk7fMzN83G 1DnCX2k0S3i+s72gifK9+86CKiJSTDPbb8gM2tqV5LHx5rM1Z8ta X-Google-Smtp-Source: AGHT+IFkAx9cKiz7pz3xgUt57V/6sA+0OrQdyJABkdoyJbJVnb4JRqGqApOBbvIKKduAp+Z6mG5qAg== X-Received: by 2002:ac2:5b1a:0:b0:513:2c86:3498 with SMTP id v26-20020ac25b1a000000b005132c863498mr3464520lfn.48.1712836803105; Thu, 11 Apr 2024 05:00:03 -0700 (PDT) Received: from [1.0.0.7] ([91.185.79.145]) by smtp.gmail.com with ESMTPSA id q12-20020ac2510c000000b00513d3b5d4f5sm192692lfb.128.2024.04.11.05.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Apr 2024 05:00:01 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------kmgIY3fq1vrXG3mZjmaPcVmO" Message-ID: Date: Thu, 11 Apr 2024 15:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands Content-Language: en-US To: Dmitry Koval , Richard Guo Cc: Alexander Korotkov , PostgreSQL Hackers References: <3a4b9c1c-3edf-4e29-9629-b4113aefb0f3@postgrespro.ru> <28ed1ee0-749d-9838-955e-abff42fc44be@gmail.com> <86bfd241-a58c-479a-9a72-2c67a02becf8@postgrespro.ru> From: Alexander Lakhin In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------kmgIY3fq1vrXG3mZjmaPcVmO Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Dmitry, 11.04.2024 11:59, Dmitry Koval wrote: > >> FWIW, I also proposed a patch earlier that fixes error messages and >> comments in the split partition code > > Sorry, I thought all the fixes you suggested were already included in v1-0002-Fixes-for-english-text.patch (but they > are not). > Added missing lines to v2-0002-Fixes-for-english-text.patch. > It seems to me that v2-0001-Fix-for-SPLIT-MERGE-partitions-of-temporary-table.patch is not complete either. Take a look, please: CREATE TABLE t (i int) PARTITION BY RANGE (i); SET search_path = pg_temp, public; CREATE TABLE tp_0_1 PARTITION OF t   FOR VALUES FROM (0) TO (1); -- fails with: ERROR:  cannot create a temporary relation as partition of permanent relation "t" But: CREATE TABLE t (i int) PARTITION BY RANGE (i); CREATE TABLE tp_0_1 PARTITION OF t   FOR VALUES FROM (0) TO (1); CREATE TABLE tp_1_2 PARTITION OF t   FOR VALUES FROM (1) TO (2); INSERT INTO t VALUES(0), (1); SELECT * FROM t; -- the expected result is:  i ---  0  1 (2 rows) SET search_path = pg_temp, public; ALTER TABLE t MERGE PARTITIONS (tp_0_1, tp_1_2) INTO tp_0_2; -- succeeds, and \c - SELECT * FROM t; -- gives:  i --- (0 rows) Please also ask your tech writers to check contents of src/test/sql/*, if possible (perhaps, they'll fix "salesmans" and improve grammar). Best regards, Alexander --------------kmgIY3fq1vrXG3mZjmaPcVmO Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Hi Dmitry,

11.04.2024 11:59, Dmitry Koval wrote:

FWIW, I also proposed a patch earlier that fixes error messages and
comments in the split partition code

Sorry, I thought all the fixes you suggested were already included in v1-0002-Fixes-for-english-text.patch (but they are not).
Added missing lines to v2-0002-Fixes-for-english-text.patch.


It seems to me that v2-0001-Fix-for-SPLIT-MERGE-partitions-of-temporary-table.patch
is not complete either.
Take a look, please:
CREATE TABLE t (i int) PARTITION BY RANGE (i);
SET search_path = pg_temp, public;
CREATE TABLE tp_0_1 PARTITION OF t
  FOR VALUES FROM (0) TO (1);
-- fails with:
ERROR:  cannot create a temporary relation as partition of permanent relation "t"

But:
CREATE TABLE t (i int) PARTITION BY RANGE (i);
CREATE TABLE tp_0_1 PARTITION OF t
  FOR VALUES FROM (0) TO (1);
CREATE TABLE tp_1_2 PARTITION OF t
  FOR VALUES FROM (1) TO (2);
INSERT INTO t VALUES(0), (1);
SELECT * FROM t;
-- the expected result is:
 i
---
 0
 1
(2 rows)

SET search_path = pg_temp, public;
ALTER TABLE t
MERGE PARTITIONS (tp_0_1, tp_1_2) INTO tp_0_2;
-- succeeds, and
\c -
SELECT * FROM t;
-- gives:
 i
---
(0 rows)

Please also ask your tech writers to check contents of src/test/sql/*, if
possible (perhaps, they'll fix "salesmans" and improve grammar).

Best regards,
Alexander
--------------kmgIY3fq1vrXG3mZjmaPcVmO--