Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hv7vm-0003Qk-9t for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Aug 2019 22:27:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hv7vk-0004af-Qa for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Aug 2019 22:27:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hv7vk-0004aX-I9 for pgsql-hackers@lists.postgresql.org; Tue, 06 Aug 2019 22:27:44 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hv7vh-00018f-CB for pgsql-hackers@lists.postgresql.org; Tue, 06 Aug 2019 22:27:43 +0000 Received: by mail-qk1-x743.google.com with SMTP id r6so64309979qkc.0 for ; Tue, 06 Aug 2019 15:27:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=e3YjQmbU5wI7ua2bHzVxSxZo6bPsHoRy87818qATBMc=; b=yLriXpx/5zVDOoA9Chac3Wq7HYpGNsQSNf/NSaOzy77phqPHmjr7F3nL4dnV5Nd74/ ML9U4D5kn2GdbGJf91mM/7ArxGhJKeRJ96CmaY+JI5IpI57p/TNlia70LX+HU7ubhwuW 8ZMBHsIclF/DUhlsn7AAEy5o7humc4iSMsXkBeNStqgJwUNLOv38v5o5fTwYjsWsj9jy ZPs7cZVnFLsbI+5VKMdbv5b9pEqefrapnu+/AD6yYL15EV+IVm4XH0fEaBodwl0DGECy iWS4W6d0rZexrDEZR3Nu4Zjnemj/SwXqkLswRldCdMu2Jq9B78vm8ZJ2Ufuir3/EbOLa 6hyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=e3YjQmbU5wI7ua2bHzVxSxZo6bPsHoRy87818qATBMc=; b=D6izbDn7rPYkz3tThkmgn+oY7l4G6PlveUXY21n0pmF9VlytawwZPJWvlIS7zMu5ci 3Hjz31VokR1crkILk/NntnAlqIqaX9yrm0zVarNsvb2IgTgW2GC+9N/diUXx/hwXdv7X Q29KNEgd64b0v8gAVBrmh7GW0tuDC5TmdpsxIJG5uCNRfwUaBFx4XJeJLTezb8svyL1t 3jEOeJ77QUb9viIcfwiiT+yZ/q7ezVcUda7X+lIH4R0dsGU4pSUFzb+FROXVJR97O+0q JY/Yv8Yp6VNMmskKdsi6SddkQiuihD4aqez8DxDZoxzZdbgRiEaElF/SHWkQRcBPpR75 +9vg== X-Gm-Message-State: APjAAAWGMzw/jWKyiWPP6PSYAVAeUxSeKslgd1QcuzdsRQcGdMNnnE0r dx+9g6sUR770yJ0kPyikdf8/m1pRQgz3XmcnPZum0GNTb7CIdu7v6k5QU9r3Pb+MbOr9d4MqL2W A/W5nXRKlT6akF9K4BT1gadFOdvPxEYufaKv+fkQ6ig/l8aczrh/V/3zc62gqG7JwJjThHSWZse RkpezHsB6/JuH4Ag== X-Google-Smtp-Source: APXvYqwL7LtUCSmMeOw+LfBLIuz9Ub2pFr5zC0W4lCjbDHfQ0ecfKxbdRA0yRBApsW7xSKlV6ApxPA== X-Received: by 2002:a37:7646:: with SMTP id r67mr5555640qkc.249.1565130458837; Tue, 06 Aug 2019 15:27:38 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.217.183.1]) by smtp.gmail.com with ESMTPSA id m10sm36935809qka.43.2019.08.06.15.27.38 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 06 Aug 2019 15:27:38 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 0342A1207B4; Tue, 6 Aug 2019 18:27:35 -0400 (-04) Date: Tue, 6 Aug 2019 18:27:35 -0400 From: Alvaro Herrera To: Pg Hackers Subject: no default hash partition Message-ID: <20190806222735.GA9535@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="RnlQjJ0d97Da+TV1" Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit Given the discussion starting at https://postgr.es/m/CAFjFpRdBiQjZm8sG9+s0x8Re-afHds6MFLgGuw0wVUNLGrVOQg@mail.gmail.com we don't have default-partition support with the hash partitioning scheme. That seems a reasonable outcome, but I think we should have a comment about it (I had to search the reason for this restriction in the hash-partitioning patch set). How about the attached? Does anyone see a reason to make this more verbose, and if so to what? ... unless somebody wants to argue that we should have the feature; if so please share your patch. Thanks -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services --RnlQjJ0d97Da+TV1 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Add-comment-on-no-default-partition-with-hash-partit.patch" From f1f5ceb124b8662f63bebc6808bcf0472b579eaa Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Tue, 6 Aug 2019 12:25:56 -0400 Subject: [PATCH] Add comment on no default partition with hash partitioning --- src/backend/parser/parse_utilcmd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index a9b2f8bacd..83c8048387 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -3727,6 +3727,10 @@ transformPartitionBound(ParseState *pstate, Relation parent, if (spec->is_default) { + /* + * Hash partitioning does not support a default partition; there's no + * use case for it and it's likely to cause trouble for users. + */ if (strategy == PARTITION_STRATEGY_HASH) ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), -- 2.17.1 --RnlQjJ0d97Da+TV1--