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 1rxUBJ-0097MS-W2 for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Apr 2024 16:00:14 +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 1rxUBI-006Vg9-LP for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Apr 2024 16:00:12 +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 1rxUBI-006Vg1-AO for pgsql-hackers@lists.postgresql.org; Thu, 18 Apr 2024 16:00:12 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rxUBD-001eTW-B0 for pgsql-hackers@lists.postgresql.org; Thu, 18 Apr 2024 16:00:11 +0000 Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-2a2d82537efso767621a91.2 for ; Thu, 18 Apr 2024 09:00:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713456005; x=1714060805; 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=npw4MManTev0Ia2tARVIod5BZEecLygTcZI7SkG+A5Y=; b=eZWNzkvtzsyubilTs+TKSz56OKfdCrhq/F/xhS0Hi3kxtjx5AXSll/FzTjR1Uv5cx+ FjKzRJCHxOroUhU2cW0Zq9i+/1BP5pxJSc3WOTBn+Y52pJzgvB8yqjnWjimZF5jTVRNe DOYJdepIOXfCuabXzGTK7CKr/+5AYSWJuLLh9Ex7y6f+gTsacVFBbgMrN/jUe99YDGPw 1pLpU2Wir5KHB1wPKAI51bAvqkMN2FjWN78mYqqCG5gwPzHgwg1Etlk1U1wqgDfeHSpX FAuDFpzoBcVRuoHRUgZtR2msGmaE19+UGDViRbLw+eAQJd+xzRI9wZy4iBU3J6HhZwi5 l4YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713456005; x=1714060805; 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=npw4MManTev0Ia2tARVIod5BZEecLygTcZI7SkG+A5Y=; b=lXERzyhGzU07ftpqEIavUYASG32KRUSmOAaBK7qMAhFecgXWy7M5KkSKQhjjY2pYli bYgEgVNIYip7MKsyZQsP9NnzmP897mkn+FeT/zAxUB/evMjVJye0Nv65gUT/F1Tb1NE/ 6VXf8WdM+TNX4ArMzc/dJ2nPQVtnCsmA12Wl+7TPv1YKJZpp3H5hqRtzd4lJ/UIO66Zu kZXbUsFEYXcTr8y0tkV+2cGjOrH7xhdmFgbY6eQudg0r88Eu8Xv10QNqv9wZwcCmSHk5 Jm4pMz1ZSA2Z/UScp12+IV4c4mDi0gP2aVoqeT/WESKRMtmTQHc4y2+EjHBJyCkCOP7l VbbA== X-Forwarded-Encrypted: i=1; AJvYcCVULim4NsFKMqE/3BQcI7O8pQR4d/o5E9kZLie2R3TafIsBwSMS+AMO2Fht4x0C5HmMFtm2ZqrbAyRDR3IQ4R+JhKYIpDAZUVbohir3qhn7csAY X-Gm-Message-State: AOJu0YyiuvluxSw4ILEYtDg6HO5hL001YTFgbjEC4kIJ3n9oXDm8QP6L 6gHzc3kpnq4JPRg3boURXGkajjRUt+BUxGZhPD9ejywnraXnjic3 X-Google-Smtp-Source: AGHT+IGAVYEZMi1fCE1XQMeOfyEYx2plDky2Y/o/N55yUSMK3VZIsDfp96ddAz5TnSLMHrKSPLuwzg== X-Received: by 2002:a17:90a:db51:b0:2a5:e087:768a with SMTP id u17-20020a17090adb5100b002a5e087768amr3378246pjx.29.1713456005076; Thu, 18 Apr 2024 09:00:05 -0700 (PDT) Received: from [1.0.0.7] ([178.155.16.75]) by smtp.gmail.com with ESMTPSA id 65-20020a17090a09c700b002a5d20778ebsm3628290pjo.32.2024.04.18.09.00.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Apr 2024 09:00:04 -0700 (PDT) Message-ID: <5dee3937-8e9f-cca4-11fb-737709a92b37@gmail.com> Date: Thu, 18 Apr 2024 19: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: Alexander Korotkov , Dmitry Koval Cc: Robert Haas , PostgreSQL Hackers References: <86bfd241-a58c-479a-9a72-2c67a02becf8@postgrespro.ru> <0f655bcd-6487-4179-f9cf-c248efbad510@gmail.com> <56e0000c-6b39-44ce-90b4-d3c3062e408c@postgrespro.ru> From: Alexander Lakhin In-Reply-To: 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 Hi Alexander, 18.04.2024 13:35, Alexander Korotkov wrote: > > The revised patchset is attached. > 1) I've split the fix for the CommandCounterIncrement() issue and the > fix for relation persistence issue into a separate patch. > 2) I've validated that the lock on the new partition is held in > createPartitionTable() after ProcessUtility() as pointed out by > Robert. So, no need to place the lock again. > 3) Added fix for problematic error message as a separate patch [1]. > 4) Added rename "salemans" => "salesmen" for tests as a separate patch. > > I think these fixes are reaching committable shape, but I'd like > someone to check it before I push. I think the feature implementation should also provide tab completion for SPLIT/MERGE. (ALTER TABLE t S fills in only SET now.) Also, the following MERGE operation: CREATE TABLE t (i int, PRIMARY KEY(i)) PARTITION BY RANGE (i); 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); ALTER TABLE t MERGE PARTITIONS (tp_0, tp_1) INTO tp_0; leaves a strange constraint: \d+ t*                                           Table "public.tp_0" ... Not-null constraints:     "merge-16385-26BCB0-tmp_i_not_null" NOT NULL "i" Best regards, Alexander