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 1rxk6J-00BQun-P2 for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Apr 2024 09:00:07 +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 1rxk6I-00HaZh-Gt for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Apr 2024 09:00:06 +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.94.2) (envelope-from ) id 1rxk6I-00HaZZ-7A for pgsql-hackers@lists.postgresql.org; Fri, 19 Apr 2024 09:00:06 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rxk6F-001m8Y-W8 for pgsql-hackers@lists.postgresql.org; Fri, 19 Apr 2024 09:00:05 +0000 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-516f2e0edb7so2407487e87.1 for ; Fri, 19 Apr 2024 02:00:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713517203; x=1714122003; darn=lists.postgresql.org; h=content-transfer-encoding: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=wr3nhWeVXkUFYUt+v8lFh9fOOnS9Z9DbfYUADgbUMyk=; b=VMubjSwRDLfoRMeQ0/gFmPF9i8hV+cDXHzMiAqvrxd0li7PK+7N6l7wRXAQCjeKaKu AHX8x3t9oTtAxo5C8TmYXSQvXGF0uMYxTRQHh1r7cf6+g8dsbm8ZOAOrYiUkyhhauCVL zGLQ3LPT9tbGvdGORiVx42SaVvZEZodjc2kXdv2DAPK2Zn0EJAOUnW/AR1w0p6JQkOfW uL6JcAKX3EXBltk3IdLS+TqmTbX8a5humEzz0izCutauuFqk058jEhOeNDFUxC/trCqA Vg+60bQhRow/4R7P+FDxyj0S6zUbLOxqLay2ZjbgQ22MpGIFNehc/30nhZqDdKnDGsV8 Ligw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713517203; x=1714122003; h=content-transfer-encoding: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=wr3nhWeVXkUFYUt+v8lFh9fOOnS9Z9DbfYUADgbUMyk=; b=kJkXeuJIAFXO3Q0UrabUUI2Q4aUcNT+mu8ofMtdFJ62nsBqXPThCIyC0TNSWE0HBvV MjgeuDEJAqwK+6UFkZYEUpmysVW5Wh//0AoTJ/k6vk/uEsyyliytFAbABj2/Ra2x82vI gltI6Zcoqd0DONCoPQNs78CXUSWJr1fPfnf/Xc7awm/mkdcE7tq8Dbizgcb7ajKEWqM8 OXUMDZ60Hd6vFPtpx3SA2CdhXub44RFSEpxtRwa818pLTvxh25Hga9FknHC5HLSXrQiw k1mWsrd/gcIFS5NGovNVGUhlUQ6Jirj7Y/8PSWana3KHY/iBNycEthGq9cN3EYiGyXzv xzEA== X-Forwarded-Encrypted: i=1; AJvYcCXvAMBXGotnDLAmV6+84+jpogW6WpdeDQTSNkcJsYBnpDxFFC5kYxLY0J18GPwDkLjDhVf4kopK2BsuTMKzpNDYQSDx2DMchFFaiS/BS245pJAH X-Gm-Message-State: AOJu0YyLCuHXz/4CnJ87eaBB0Lvt33ZVI3fceQdsBhmzep3j7vsg9o/v nSREQKK5k7v8CfoKQG5c4NGoqqF8fPZxRTtrXzL/DSnn+BWQQJNz X-Google-Smtp-Source: AGHT+IG1URLzR/EGNs4YssJ2IZJEzyrUn9hPngkDUqUqd31mFRM0AS53+5JC/bT03mFAuBZD03q80w== X-Received: by 2002:ac2:515b:0:b0:519:6794:1018 with SMTP id q27-20020ac2515b000000b0051967941018mr885975lfd.28.1713517202592; Fri, 19 Apr 2024 02:00:02 -0700 (PDT) Received: from [1.0.0.7] ([178.155.16.75]) by smtp.gmail.com with ESMTPSA id i1-20020a198c41000000b00518c3eb3a9csm621761lfj.309.2024.04.19.02.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Apr 2024 02:00:02 -0700 (PDT) Message-ID: <84ada05b-be5c-473e-6d1c-ebe5dd21b190@gmail.com> Date: Fri, 19 Apr 2024 12: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: Alvaro Herrera Cc: Alexander Korotkov , Dmitry Koval , Robert Haas , PostgreSQL Hackers , =?UTF-8?Q?Dagfinn_Ilmari_Manns=c3=a5ker?= References: <202404181749.2jibl7x2ao5n@alvherre.pgsql> From: Alexander Lakhin In-Reply-To: <202404181749.2jibl7x2ao5n@alvherre.pgsql> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 18.04.2024 20:49, Alvaro Herrera wrote: > On 2024-Apr-18, Alexander Lakhin wrote: > >> I think the feature implementation should also provide tab completion >> for SPLIT/MERGE. > I don't think that we should be imposing on feature authors or > committers the task of filling in tab-completion for whatever features > they contribute. I mean, if they want to add that, cool; but if not, > somebody else can do that, too. It's not a critical piece. I agree, I just wanted to note the lack of the current implementation. But now, thanks to Dagfinn, we have the tab completion too. I have also a question regarding "ALTER TABLE ... SET ACCESS METHOD". The current documentation says: When applied to a partitioned table, there is no data to rewrite, but partitions created afterwards will default to the given access method unless overridden by a USING clause. But MERGE/SPLIT behave differently (if one can assume that MERGE/SPLIT create new partitions under the hood): CREATE ACCESS METHOD heap2 TYPE TABLE HANDLER heap_tableam_handler; CREATE TABLE t (i int, PRIMARY KEY(i)) PARTITION BY RANGE (i); ALTER TABLE t SET ACCESS METHOD heap2; CREATE TABLE tp_0 PARTITION OF t FOR VALUES FROM (0) TO (1); CREATE TABLE tp_1 PARTITION OF t FOR VALUES FROM (1) TO (2); \d t+                                       Partitioned table "public.t" ... Access method: heap2                                           Table "public.tp_0" ... Access method: heap2                                           Table "public.tp_1" ... Access method: heap2 ALTER TABLE t MERGE PARTITIONS (tp_0, tp_1) INTO tp_0;                                       Partitioned table "public.t" ... Access method: heap2                                           Table "public.tp_0" ... Access method: heap Shouldn't it be changed, what do you think? Best regards, Alexander