Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nvz9C-0003b8-1e for pgsql-hackers@arkaria.postgresql.org; Tue, 31 May 2022 10:30:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nvz98-00051J-Qw for pgsql-hackers@arkaria.postgresql.org; Tue, 31 May 2022 10:30:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nvz98-000519-F8 for pgsql-hackers@lists.postgresql.org; Tue, 31 May 2022 10:30:42 +0000 Received: from mail-vs1-xe36.google.com ([2607:f8b0:4864:20::e36]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nvz93-0007Eh-Me for pgsql-hackers@lists.postgresql.org; Tue, 31 May 2022 10:30:41 +0000 Received: by mail-vs1-xe36.google.com with SMTP id i186so13107496vsc.9 for ; Tue, 31 May 2022 03:30:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Vpz/6mZQxUu7xe20zBCrgWz+z6tA3/dyGtqZ5NSHYKg=; b=nE0rfGd9dc5pFMkYlfStaDNufshpKy+gKcn3yyp9narkR7Ss7c7lcGV/gvaM7SgN0g 5/mgY4TjxgqoIVDZKqp6KG6dAJuoi/JNfltywCA0nQyi7ijoJSBN+CMtuMaSPVDSL452 XtGEvf+Mti2ZQZ8GyF0Y+s2Sxfvm122rTdnbAYnnkBqd4eI1nQCt+P4ht4v4l8uOWIyP OtKjMJsWLkzsBk90AyBo4/lUP0oVq2v+2oR3bwuGQB4It5SPObVszBkOnfsogSJMAlTP 2/2Dlp0fWE/1mWmHeoUv46qH+glsvm3HRKwoV1FAwkUyxB72X0q3XrQ+LK1281JgYB4L sqGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Vpz/6mZQxUu7xe20zBCrgWz+z6tA3/dyGtqZ5NSHYKg=; b=2IQwRe7FxuEgGty8iynBLBndB9XD1fmHuH7XFiQcQMA6lKqozeKADJ6O6UqRer93Lw mvLAmYUipYJ+K9GBiVs+Q9AlOgpko8wHuTcaR8BOleypSGZuQUiwrZlS/pRrBI2f+pYK E5AfeUKYm4OsGDGUD7Pi1byqV9Mz3c8AFl88wjMC6gV63GMI3iUgyAODI/OYHCzyIW0W Lj0znA2O+LHe/LCyLkGvAFEk++yIC6kuMIMQqzJ+OOCvqcFHkesv9xIdu5K1S/Pu2bwu 78/eET1R8WrGiVcLRlDXq6pSe9YTEHhGDKFfx6Rc9vSmTHF+vs7lFf5WMlPEc9W5gAlh f0SQ== X-Gm-Message-State: AOAM533AiVh07qovbRjqL4QAscHAN0tBnDLLrzaLNidPYLdsgEKjYHBQ PzmooRBewYW8lxohDy5x5kJv84kuaakcEnZTWg/by5LIGIQ= X-Google-Smtp-Source: ABdhPJxbhCT7UA2rW2IN6aJfkOjxK3ftE0tnSmVoUzUVB9k33WOP2NbRw3UzalliuE3nlBwG638rjXgFZSetQMbKqu0= X-Received: by 2002:a05:6102:950:b0:337:971a:d662 with SMTP id a16-20020a056102095000b00337971ad662mr21390346vsi.2.1653993035709; Tue, 31 May 2022 03:30:35 -0700 (PDT) MIME-Version: 1.0 References: <163714495450.16056.3566953095730878367@malur.postgresql.org> In-Reply-To: From: Matthias van de Meent Date: Tue, 31 May 2022 12:30:22 +0200 Message-ID: Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands To: Dmitry Koval Cc: PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 31 May 2022 at 11:33, Dmitry Koval wrote: > > Hi, hackers! > > There are not many commands in PostgreSQL for working with partitioned > tables. This is an obstacle to their widespread use. > Adding SPLIT PARTITION/MERGE PARTITIONS operations can make easier to > use partitioned tables in PostgreSQL. That is quite a nice and useful feature to have. > (This is especially important when migrating projects from ORACLE DBMS.) > > SPLIT PARTITION/MERGE PARTITIONS commands are supported for range > partitioning (BY RANGE) and for list partitioning (BY LIST). > For hash partitioning (BY HASH) these operations are not supported. Just out of curiosity, why is SPLIT / MERGE support not included for HASH partitions? Because sibling partitions can have a different modulus, you should be able to e.g. split a partition with (modulus, remainder) of (3, 1) into two partitions with (mod, rem) of (6, 1) and (6, 4) respectively, with the reverse being true for merge operations, right? Kind regards, Matthias van de Meent