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 1kFzlO-0005jU-Os for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Sep 2020 13:03:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kFzlN-0007RI-G9 for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Sep 2020 13:03:49 +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 1kFzlN-0007QT-75 for pgsql-hackers@lists.postgresql.org; Wed, 09 Sep 2020 13:03:49 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kFzlK-000775-K7 for pgsql-hackers@lists.postgresql.org; Wed, 09 Sep 2020 13:03:48 +0000 Received: from mail.postgrespro.ru (cyclops.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 4246421C1D87; Wed, 9 Sep 2020 16:03:45 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1599656625; bh=XP67YY76BQ49rPpDXxnklkJb1yRnROYsD35Kbow1Pp8=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=l1ISynijAz5idJbOgnx0a1Phu85OCULFw19V/DUGgRc2EAuwnURXPwv9UWGWBQmj2 A0XgtV1nd7GxTgMH80fkk6vJGEr6mqOqAcK2XsgQtwk5mn1atL+zHHHzQw5qBPUd5l EGsF665/Va8TnG6g6yZDGKVXKzKQZwNu+bb3FezY= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 09 Sep 2020 16:03:45 +0300 From: Alexey Kondratov To: Michael Paquier Cc: Justin Pryzby , Alvaro Herrera , Masahiko Sawada , Steve Singer , pgsql-hackers@lists.postgresql.org, Robert Haas , Alexander Korotkov , Masahiko Sawada , Jose Luis Tallon Subject: Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly In-Reply-To: <20200909122200.GA2743@paquier.xyz> References: <20200908233951.GC18552@telsasoft.com> <20200909000238.GA1563@alvherre.pgsql> <20200909001757.GD18552@telsasoft.com> <20200909122200.GA2743@paquier.xyz> User-Agent: Roundcube Webmail/1.4.0 Message-ID: X-Sender: a.kondratov@postgrespro.ru List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-09-09 15:22, Michael Paquier wrote: > On Tue, Sep 08, 2020 at 07:17:58PM -0500, Justin Pryzby wrote: >> Initially I added List *params, and Michael suggested to retire >> ReindexStmt->concurrent. I provided a patch to do so, initially by >> leaving int >> options and then, after this, removing it to "complete the thought", >> and get >> rid of the remnants of the "old way" of doing it. This is also how >> vacuum and >> explain are done. >> https://www.postgresql.org/message-id/20200902022410.GA20149%40telsasoft.com > > Defining a set of DefElem when parsing and then using the int > "options" with bitmasks where necessary at the beginning of the > execution looks like a good balance to me. This way, you can extend > the grammar to use things like (verbose = true), etc. > > By the way, skimming through the patch set, I was wondering if we > could do the refactoring of patch 0005 as a first step > Yes, I did it with intention to put as a first patch, but wanted to get some feedback. It's easier to refactor the last patch without rebasing others. > > until I > noticed this part: > +common_option_name: > NonReservedWord { $$ = $1; } > | analyze_keyword { $$ = "analyze"; } > This is not a good idea as you make ANALYZE an option available for > all the commands involved in the refactoring. A portion of that could > be considered though, like the use of common_option_arg. > From the grammar perspective ANY option is available for any command that uses parenthesized option list. All the checks and validations are performed at the corresponding command code. This analyze_keyword is actually doing only an ANALYZE word normalization if it's used as an option. Why it could be harmful? Regards -- Alexey Kondratov Postgres Professional https://www.postgrespro.com Russian Postgres Company