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 1s1VIP-00Cmuu-Fo for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Apr 2024 18: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 1s1VIM-0015in-Ls for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Apr 2024 18:00:07 +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 1s1VIM-0015ie-C1 for pgsql-hackers@lists.postgresql.org; Mon, 29 Apr 2024 18:00:07 +0000 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s1VIK-000du1-Pf for pgsql-hackers@lists.postgresql.org; Mon, 29 Apr 2024 18:00:06 +0000 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-5171a529224so6063285e87.0 for ; Mon, 29 Apr 2024 11:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714413603; x=1715018403; 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=LxFzkvR/obGmCVPFmMhz/ubWu8vc6E05vaObDtbZ2qo=; b=Yd1T9M5BviA2OrxzqWXXZFKapw3lnJlw9nbcwLIqkZYi9HVws5kL35iMKvirOlpj+V pVo0oz64h46WYKOxFrG4gtpBJD6zSTJJQTfFOuuTQx1VY3oRzHwR3rwyGeffP8TAZsGp ETgvT7F7PC0VmInGMo85ASygOq1N7eIjOEHxiS/WRpwOJwedjA5S6pfkTI4jJNXkGK/K 6FsDuu9/AzHTmlfpMaWp4kPtReyeaG1dy/Mgy5TS9apFw/t8usjUiXB/JrNXJja8F7jK i5A5oILVaA5X+mRjA0TQqMmSJ6P+JSEkhVhPUeT9TJJPOd1byGfOlc0+akYMR3YopmGK 0gBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714413603; x=1715018403; 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=LxFzkvR/obGmCVPFmMhz/ubWu8vc6E05vaObDtbZ2qo=; b=MS/APfwzxLnPHXefuz/Kpp0glkAue/4bTiTsMAzMMCkwU41oLPVKHBME+FeVnV9Eta LYg3TXEMDO1GeUSgEvBKJN83I3Osn0tFpqAegGDlAh8VO9NTrWoDSxHGoK/4+5ErdD+B 46OSaUMgIKaileiPEwMrFoYdimKhvY7RiY230zz1ni+J3upN/j39GQeGFbHEM24KD3Cg GzYMJReF7WwaKB/m/IdX5dgOEogIroW6+EIXdyF7kS8JvxMVEz6+zS8a//1Igf+ZTL5i 68uW2agytUXNrHsHsQL9BauyBKATYK+owkmi3i6JVi3ggNFKuO9IeUBSOix1iFE+PH6C 0skA== X-Forwarded-Encrypted: i=1; AJvYcCXQCc0zKwPVdt8Y+mva9uSR/Y0RTN/R9AS9+SG/ohag9+axdLHI4qAEld1HGyYuX6imUUSbdrhQlT18NjNeJiL2MwhxpAW8PnsRXAjgo0HfS7NX X-Gm-Message-State: AOJu0YwoCkxtqPfDEbsm+Y8SUl2JD+XLOy3AFov2SOC9Ej0RrH2U/HAE FM6T+4/6HSXNcODOblYB5ROWUFNmze7YL9+UPgGGBvq/2ZH21aSmb98kXyA6 X-Google-Smtp-Source: AGHT+IEFXGWBCwWhmRO5yw2eG7LDzM+vfLxuFTPJgxnGuiYOfb/NbWs9KFR4iqQ8VSu8Lw194BGD3A== X-Received: by 2002:a05:6512:447:b0:519:a55:7ee2 with SMTP id y7-20020a056512044700b005190a557ee2mr226027lfk.68.1714413602871; Mon, 29 Apr 2024 11:00:02 -0700 (PDT) Received: from [1.0.0.7] ([178.155.23.194]) by smtp.gmail.com with ESMTPSA id b26-20020ac247fa000000b0051c6c886e09sm1518888lfp.121.2024.04.29.11.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Apr 2024 11:00:02 -0700 (PDT) Message-ID: Date: Mon, 29 Apr 2024 21:00:01 +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 , Alexander Korotkov 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> <5dee3937-8e9f-cca4-11fb-737709a92b37@gmail.com> 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 Dmitry, 19.04.2024 02:26, Dmitry Koval wrote: > > 18.04.2024 19:00, Alexander Lakhin wrote: >> leaves a strange constraint: >> \d+ t* >>                                            Table "public.tp_0" >> ... >> Not-null constraints: >>      "merge-16385-26BCB0-tmp_i_not_null" NOT NULL "i" > > Thanks! > Attached fix (with test) for this case. > The patch should be applied after patches > v6-0001- ... .patch ... v6-0004- ... .patch I still wonder, why that constraint (now with a less questionable name) is created during MERGE? That is, before MERGE, two partitions have only PRIMARY KEY indexes, with no not-null constraint, and you can manually remove the constraint after MERGE, so maybe it's not necessary... Best regards, Alexander