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 1oEYu6-0006t3-1J for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Jul 2022 16:19:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oEYu4-00061a-MS for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Jul 2022 16:19:56 +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 1oEYu4-0005u5-CO for pgsql-hackers@lists.postgresql.org; Thu, 21 Jul 2022 16:19:56 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oEYu1-0004x6-U5 for pgsql-hackers@postgresql.org; Thu, 21 Jul 2022 16:19:56 +0000 Received: by mail-lf1-x12b.google.com with SMTP id z22so3564942lfu.7 for ; Thu, 21 Jul 2022 09:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=f8pbb+jZNg2QxbFlzeHQ+y8BTt7ROQCLpA8JUfes7dk=; b=fZt+sMWANt/HlVGf7ACgus1fhVBVeLHpwRTqHWXGG4S0ImtfOMp6Q5VeU4dnIdzWEh K6BaPuOKu5KreRT4S7U/Q2WYF1Jh204v+1GJCpQnliPeObh9jzN/4h2xSr0vjw3dtuiU B5GoR14HjxUyYnDCjR12OaUZOd8xangQ0hg+YdzuQdjTRrNYfojy+AwHwcfjLWXlPNaU bkixXNMeIEWfppkWWOjagBYjJOH8egMabr+Aui1icf7QGWs2nH/xgs47G0BMIC39cnYW Pp42J+yrK7RluCO2sfSlj3LBBJKhuq5kXeBDb/GmPbIHOdDNs9Qa+u+b+MiCldEtRoTX Q36Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=f8pbb+jZNg2QxbFlzeHQ+y8BTt7ROQCLpA8JUfes7dk=; b=cjnmlU2TKqyaZ30xAJXwDyJa6Bt8Ml9yKXvvCeRuychhuaME+t09LsLXTnl8NSc6Vn GAgC7+WefFwVS7gl3VZP8pR2xji/LS/SqAB8VX4BOwMAUjK4//u/NiYy8swEn5HmqJ10 pA2R8MAa2W7KoAOpK5YsAhYLQp0TChbVL+BVEKG5CBOKmBeH3qDzrLd5WvwziWl8s9vi QmybNA/vKKKvNkEUW5n3NMfpIhG9gKIoJ6pAYtqXa4o+XZ8Jy3yypxk/HDWlgK6XPhJ9 Jx4qqknXClUDpEIvfwu2m7v5TmhEae+5ee5vuNmR9PxzGlm6nD8nj0P9rIO9PSIwQzBp wRRQ== X-Gm-Message-State: AJIora82knSrWLOEYQy97jrLWlEIC4hO7P7Szo0W0boB/XZcqWc4y95N IdXGJi5UGsZe+Z4Tu96ti+ZnlZhN/BR0DpjRhU4/FhkRzBKvzQMSMzrhn9NZBazp8gFfouC1wn4 1iX1mfxo4baRv+sv/ctX4CABBw1p5k9pOzm7wctR6fBLZafFmIvRtJPBhaAWbscGtNir4W2qd5e oGqT4ATAt7t0Y3A+hliAKEwXS91o/hr80DEy+8 X-Google-Smtp-Source: AGRyM1upFehzmUu8ND/Y2DafL8AuQRQo3i9OHytfRMZbijEO05oNdczfdyePJwNccddhd99boy4YqQ== X-Received: by 2002:a05:6512:1290:b0:488:72e0:9a10 with SMTP id u16-20020a056512129000b0048872e09a10mr21933309lfs.63.1658420392327; Thu, 21 Jul 2022 09:19:52 -0700 (PDT) Received: from [10.137.0.17] (84-217-81-189.customers.ownit.se. [84.217.81.189]) by smtp.gmail.com with ESMTPSA id t28-20020a2e8e7c000000b0025d4d9be72csm615928ljk.3.2022.07.21.09.19.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Jul 2022 09:19:51 -0700 (PDT) Message-ID: Date: Thu, 21 Jul 2022 18:19:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: Make name optional in CREATE STATISTICS Content-Language: en-US To: Dean Rasheed , Matthias van de Meent Cc: Simon Riggs , PostgreSQL Hackers References: From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 7/21/22 16:12, Dean Rasheed wrote: > On Wed, 20 Jul 2022 at 12:01, Matthias van de Meent > wrote: >> >> On Wed, 13 Jul 2022 at 08:07, Simon Riggs wrote: >>> >>>> + * CREATE STATISTICS [ [IF NOT EXISTS] stats_name ] >> >> I think this is ready for a committer, so I've marked it as such. >> > > Picking this up... > > I tend to agree with Matthias' earlier point about avoiding code > duplication in the grammar. Without going off and refactoring other > parts of the grammar not related to this patch, it's still a slightly > smaller, simpler change, and less code duplication, to do this using a > new opt_stats_name production in the grammar, as in the attached. > > I also noticed a comment in CreateStatistics() that needed updating. > > Barring any further comments, I'll push this shortly. > +1 -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company