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 1iaaQL-0004Yb-7m for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Nov 2019 07:10:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iaaQI-0004hu-Mt for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Nov 2019 07:10:38 +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 1iaaQI-0004hm-D9 for pgsql-hackers@lists.postgresql.org; Fri, 29 Nov 2019 07:10:38 +0000 Received: from sraihb2.sra.co.jp ([202.32.10.6]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iaaQB-0000uH-Ch for pgsql-hackers@postgresql.org; Fri, 29 Nov 2019 07:10:37 +0000 Received: from srascf.sra.co.jp (srascf [133.137.8.80]) by sraihb2.sra.co.jp (Postfix) with ESMTP id A48B42A164D for ; Fri, 29 Nov 2019 16:10:29 +0900 (JST) Received: from srascb.sra.co.jp (unknown [133.137.8.65]) by srascf.sra.co.jp with smtp id 6841_2a78_49e871a3_f95c_4f27_b9d0_335eae448c13; Fri, 29 Nov 2019 16:10:29 +0900 Received: from sranhm.sra.co.jp (osspc25 [133.137.174.97]) by srascb.sra.co.jp (Postfix) with ESMTP id 6B87B2D6944 for ; Fri, 29 Nov 2019 16:10:29 +0900 (JST) Received: from DESKTOP-BV1V8US (dhcp-175-196.sra.co.jp [133.137.175.196]) by sranhm.sra.co.jp (Postfix) with SMTP id 28FB1A1131; Fri, 29 Nov 2019 16:10:29 +0900 (JST) Date: Fri, 29 Nov 2019 16:10:40 +0900 From: Takuma Hoshiai To: nuko yokohama Cc: pgsql-hackers@postgresql.org, Tatsuo Ishii , alvherre@2ndquadrant.com, thomas.munro@gmail.com, kgrittn@gmail.com, Yugo Nagata Subject: Re: Implementing Incremental View Maintenance Message-Id: <20191129161040.4a7669eb85a78f1db1eb8ca4@sraoss.co.jp> In-Reply-To: <20191129154513.943f4ef05896d7b9d3fed69f@sraoss.co.jp> References: <20190912151950.GA933@alvherre.pgsql> <20190917.114913.2084517550718188623.t-ishii@sraoss.co.jp> <20190930223414.62e45861094e8ee68c2d0cbb@sraoss.co.jp> <20191122.152945.1693997586349309130.t-ishii@sraoss.co.jp> <20191126160225.a0e95389a0f83b9257080745@sraoss.co.jp> <20191129154513.943f4ef05896d7b9d3fed69f@sraoss.co.jp> X-Mailer: Sylpheed Pro 2.5.1 (GTK+ 2.24.23; i686-pc-mingw32; Pro 2.5.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, 29 Nov 2019 15:45:13 +0900 Yugo Nagata wrote: > The following review on our patch was posted on another thread, > so I quote here. The tab completion is Hoshiai-san's work, so > he will handle this issue. > > Regards, > Yugo Nagata. > > On Thu, 28 Nov 2019 13:00:05 +0900 > nuko yokohama wrote: > > > Hi. > > > > I'm using the "Incremental Materialized View Maintenance" patch and have > > reported the following issues. > > (https://commitfest.postgresql.org/25/2138/) > > > > To Suggest a "DROP INCREMENTAL MATERIALIZED VIEW" in psql, but the syntax > > error when you run. > > ("DROP MATERIALIZED VIEW" command can drop Incremental Materialozed view > > normally.) Thank you for your review. This psql's suggestion is mistake, "INCREMENTAL MATERIALIZED" phrase is only used for CREATE statement. I will fix it as the following: diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 2051bc3..8c4b211 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -1001,7 +1001,7 @@ static const pgsql_thing_t words_after_create[] = { {"FOREIGN TABLE", NULL, NULL, NULL}, {"FUNCTION", NULL, NULL, Query_for_list_of_functions}, {"GROUP", Query_for_list_of_roles}, - {"INCREMENTAL MATERIALIZED VIEW", NULL, NULL, &Query_for_list_of_matviews}, + {"INCREMENTAL MATERIALIZED VIEW", NULL, NULL, &Query_for_list_of_matviews, THING_NO_DROP | THING_NO_ALTER}, {"INDEX", NULL, NULL, &Query_for_list_of_indexes}, {"LANGUAGE", Query_for_list_of_languages}, {"LARGE OBJECT", NULL, NULL, NULL, THING_NO_CREATE | THING_NO_DROP}, Best Regards, Takuma Hoshiai > > ramendb=# CREATE INCREMENTAL MATERIALIZED VIEW pref_count AS SELECT pref, > > COUNT(pref) FROM shops GROUP BY pref; > > SELECT 48 > > ramendb=# \d pref_count > > Materialized view "public.pref_count" > > Column | Type | Collation | Nullable | Default > > ---------------+--------+-----------+----------+--------- > > pref | text | | | > > count | bigint | | | > > __ivm_count__ | bigint | | | > > > > ramendb=# DROP IN > > INCREMENTAL MATERIALIZED VIEW INDEX > > ramendb=# DROP INCREMENTAL MATERIALIZED VIEW pref_count; > > 2019-11-27 11:51:03.916 UTC [9759] ERROR: syntax error at or near > > "INCREMENTAL" at character 6 > > 2019-11-27 11:51:03.916 UTC [9759] STATEMENT: DROP INCREMENTAL > > MATERIALIZED VIEW pref_count; > > ERROR: syntax error at or near "INCREMENTAL" > > LINE 1: DROP INCREMENTAL MATERIALIZED VIEW pref_count; > > ^ > > ramendb=# DROP MATERIALIZED VIEW pref_count ; > > DROP MATERIALIZED VIEW > > ramendb=# > > > > > > Regard. > > > -- > Yugo Nagata > > > -- > Yugo Nagata > -- Takuma Hoshiai