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 1krjC6-0001Do-5t for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Dec 2020 15:03:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1krjC4-0004wx-NB for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Dec 2020 15:03:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1krjC4-0004wq-9v for pgsql-hackers@lists.postgresql.org; Tue, 22 Dec 2020 15:03:20 +0000 Received: from mail-vs1-xe2e.google.com ([2607:f8b0:4864:20::e2e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1krjC1-0003Vu-Hh for pgsql-hackers@lists.postgresql.org; Tue, 22 Dec 2020 15:03:19 +0000 Received: by mail-vs1-xe2e.google.com with SMTP id u7so7151078vsg.11 for ; Tue, 22 Dec 2020 07:03:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ISIAQ/n91y2I92XGVqckGaRl9wdqE2FtZDYunTJ3lNA=; b=oF24KZ+y9AfBugg0FJkfDfbPd5ahh4U3wJIAvJJETPTF1Z8WWoMF3agYVTv+8N+vwH II8UaIeid0Xo6tr+ritRkIF88OOPZy232r+UPWUiEwSC1LbsAhNVP5ajw6ZEjIZOVuor 6jWgJo4ab5CBTfkk3Ce0ULUI0WhpSfd9xUuyhPn5/wSaBTzTKSkncib2Feu8WWpYPu2T V/aqsCj0l2y2UD1kkx7M6REK8km8u+EwDvNT8Ppd7HItHUyd8i5TG1M6kD+H6r8fu5Fh PNCamIKjtNmwwjMemPYo1WUIoPFvQh9IvZkWx/0ZSNdUYemVuZV7tpeMZbHu5xq/ftQd mjeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ISIAQ/n91y2I92XGVqckGaRl9wdqE2FtZDYunTJ3lNA=; b=HoX4F89j4fsNemS3341LARWNqX4k8tvO4fLOvenBGCdc/2ftzCW+F97HFtkfdFlmbE Lks8kJQd+6Vl2NtSY95vRVxYWoaHyznTUp1KIe6yuN9FaP76MfGlxOkk6kzZ1MBbBzq+ TfRL6pFUg1ep4G6sUx4YjN54y1TGCrcFtakHHv1WWfEMO2sovGL1XzIKlgzm/PJ/a+VO 6TqxHKZgp2jdo6ygbMbf2YXz9NlPUqF6SGTnrIdvHqNcCpMpuirjYg/MBbRDJbWbrkqQ bFLYeVbwO25GF8FYvIwxQ6oldEBU6k7SPxcPk+XqBXQNUZ//Drqou50MyJ3o5sSiXW0A FGqg== X-Gm-Message-State: AOAM533sq8Ph47FmeD9LfhefTHWs0GWbcXvo7QGcF0vaYCpmFz+kikP+ I8TE/Xi0PHZhTduK1HMqelljwK3nXnlFc+sDG5M= X-Google-Smtp-Source: ABdhPJylW9aVAHbzGgVeVzYvtO72e0aqHyhlFSzvvDVA2MiftygurRSs89AIQ7ZE7ukQei+OlH6p/oXo4+E6IPjviGo= X-Received: by 2002:a67:6b46:: with SMTP id g67mr15500552vsc.60.1608649396172; Tue, 22 Dec 2020 07:03:16 -0800 (PST) MIME-Version: 1.0 References: <7fec3abb-c663-c0d2-8452-a46141be6d4a@postgrespro.ru> <7c4013db-a628-c8bd-ce54-064389109e0f@postgrespro.ru> <726c63e2-ef34-8113-f3cf-90e1646e4c2b@postgrespro.ru> <74a716a3-986d-c737-6217-6a3ffd488da3@postgrespro.ru> <20200924032738.GA28585@paquier.xyz> <37f1072a-16ec-8ce8-8044-1fcec85c8ed5@postgrespro.ru> <199124d5-e710-71a6-1836-4653cd668d96@postgrespro.ru> <8b1fce70861e2143cef9c7a69b740d61@postgrespro.ru> In-Reply-To: From: Pavel Borisov Date: Tue, 22 Dec 2020 19:03:05 +0400 Message-ID: Subject: Re: [PATCH] Automatic HASH and LIST partition creation To: Fabien COELHO Cc: Maxim Orlov , Anastasia Lubennikova , Rahila Syed , Michael Paquier , PostgreSQL Hackers , Justin Pryzby , Robert Haas , Amul Sul Content-Type: multipart/alternative; boundary="000000000000d3bafd05b70edfc3" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000d3bafd05b70edfc3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > > CREATE TABLE foo(a int) PARTITION BY LIST(a) CONFIGURATION (FOR VALUES > IN > > (1,2),(3,4) DEFAULT PARTITION foo_def); > > I would like to disagree with this syntactic approach because it would > very specific to each partition method. IMHO the syntax should be as > generic as possible. I'd suggest (probably again) a keyword/value list > which would allow to be quite adaptable without inducing any pressure on > the parser. > If I remember your proposal correctly it is something like CREATE TABLE foo(...) PARTITION BY HASH AUTOMATIC (MODULUS 10); It is still possible but there are some caveats: 1. We'll need to add keyword MODULUS (and probably AUTOMATIC) to the parser's list. I don't against this but as far as I've heard there is some opposition among PG community against new keywords. Maybe I am wrong. 2. The existing syntax for declarative partitioning is different to your proposal. It is still not a big problem and your proposal makes query shorter for several words. I'd just like to see some consensus on the syntax. Now I must admit there are too many contradictions in opinions which make progress slow. Also I think it is important to have a really convenient synta=D1=85. 2a Maybe we all who participated in the thread can vote for some variant? 2b Maybe the existing syntax for declarative partitioniong should be given some priority as it is already committed into CREATE TABLE ... PARTITION OF ... FOR VALUES IN.. etc. I'd be happy if everyone will join some version of the proposed synta=D1=85= in this thread and in the previous discussion [1]. If we have a variant with more than one supporter, sure we can develop patch based on it. Thank you very much and Merry Christmas! [1] https://www.postgresql.org/message-id/flat/alpine.DEB.2.21.1907150711080.22= 273%40lancre --=20 Best regards, Pavel Borisov Postgres Professional: http://postgrespro.com --000000000000d3bafd05b70edfc3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> CREATE TABLE foo(a int) PARTITION BY LIST(a) CONFIG= URATION (FOR VALUES IN
> (1,2),(3,4) DEFAULT PARTITION foo_def);

I would like to disagree with this syntactic approach because it would
very specific to each partition method. IMHO the syntax should be as
generic as possible. I'd suggest (probably again) a keyword/value list =
which would allow to be quite adaptable without inducing any pressure on the parser.
If I remember your proposal correctly it i= s something like
CREATE TABLE f= oo(...) PARTITION BY HASH AUTOMATIC (MODULUS 10);

It is still possible but there are some caveats:
1. We'= ;ll need to add keyword MODULUS (and probably AUTOMATIC) to the parser'= s list. I don't against this but as far as I've heard there is some= opposition among PG community against new keywords. Maybe I am wrong.
2. The existing syntax for declarative partitioning is different to y= our proposal. It is still not a big problem and your proposal makes query s= horter for several words. I'd just like to see some consensus on the sy= ntax. Now I must admit there are too many contradictions in opinions which = make progress slow. Also I think it is important to have a really convenien= t synta=D1=85.
2a Maybe we all who participated in the thread can= vote for some variant?
2b Maybe the existing syntax for declarat= ive partitioniong=C2=A0should be given some priority as it is already commi= tted into CREATE TABLE ... PARTITION OF ... FOR VALUES IN.. etc.
=
I'd be happy if everyone will join some version of the p= roposed synta=D1=85 in this thread and in the previous discussion [1]. If w= e have a variant with more than one supporter, sure we can develop patch ba= sed on it.
Thank you very much
and Merry Christmas!

Bes= t regards,
Pavel Borisov

Postgres Professional: http://= postgrespro.com
--000000000000d3bafd05b70edfc3--