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 1ptnYz-0004Y1-0n for pgsql-hackers@arkaria.postgresql.org; Tue, 02 May 2023 10:48:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ptnYx-0006UK-KY for pgsql-hackers@arkaria.postgresql.org; Tue, 02 May 2023 10:48:51 +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 1ptnYw-0006UB-42 for pgsql-hackers@lists.postgresql.org; Tue, 02 May 2023 10:48:51 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ptnYt-0007PK-5t for pgsql-hackers@lists.postgresql.org; Tue, 02 May 2023 10:48:49 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 267D85C007B; Tue, 2 May 2023 06:48:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 02 May 2023 06:48:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilmari.org; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1683024526; x=1683110926; bh=vH nPbLDLQtHjLwBAK2MrRBKACEJMNptaJY2QIihAjGY=; b=0COx7yZqQZfpA3629B AJVULyUGqmHCxlnTnLNKN3lGB/POOhxv5GAmkZybnqN3H3D0M18F+Jd2Hcu8ZS3P vgTUbI6fY+0AHJn5ZrWqZdrDiDrTlTxLYU8WCX6SWA9d7ryh1S5y4nisLU4NDTY5 ZSKD1r4hGdT9ZipKBwyPk8bXCX3ueBUVv22BjLHOOLNT+tGG9YGDolzK7rbnHyq2 zkh9/PsXNawKS+eOwYWI2zHB37UNWQ5ZH9Q4MTKOx/ikc6n2rOCzA4H8FFbcOAzZ siqsAK3aZNbFcQtgb/ntOcQVASQIw9z8uCW+Sd4lHysSDKWBEQRKEQO3i08A0AP+ NJ/Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1683024526; x=1683110926; bh=vHnPbLDLQtHjL wBAK2MrRBKACEJMNptaJY2QIihAjGY=; b=Vliv2uwST7EUhQ2txR6qRScnl3atL f4yHxsKQEaJTQayk0/o4oGhpHIOzYzvEHjDGiW9G70LpVkt2IdbIooh73D5igmL4 ScfXrE4Z70+kwYRfqu5JTJKMuRuRqpcHQ26hIKrJw1x8PDOm64Qx6rEV5F/0IdN3 HvoC8rq+No052Ux0cW7L7MQBnpaSnq8R4tAS8fdQP/IewDQemifkZM5lc7oTW0Wo 38LNV89GYQgdIx70mQ2K/nO4eZDe5rWHfmo+FEUOnDKDhtydmnHraq6xCTMG3vLI 8F1jYNkzTD78FrNLDnQINBqVeT1W9Cw7yHGdO5a6aqCMSF1uxZDX0ajcA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedviedgfedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpefhvfevufhfffgjkfgfgggtsehttdertddt reejnecuhfhrohhmpeffrghgfhhinhhnucfklhhmrghrihcuofgrnhhnshonkhgvrhcuoe hilhhmrghrihesihhlmhgrrhhirdhorhhgqeenucggtffrrghtthgvrhhnpeekleejueef hfffkefhkedtfeeluedvieeihfehfeeffeeggeduffduheejjeeigfenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehilhhmrghrihesihhlmhgr rhhirdhorhhg X-ME-Proxy: Feedback-ID: i1ff147bf:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 2 May 2023 06:48:45 -0400 (EDT) From: =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= To: Michael Paquier Cc: Suraj Khamkar , pgsql-hackers@lists.postgresql.org Subject: Re: Tab completion for CREATE SCHEMAAUTHORIZATION References: <8735snihmz.fsf@wibble.ilmari.org> <87wnprhlsl.fsf@wibble.ilmari.org> <874kc1gdxc.fsf@wibble.ilmari.org> <87im0efqhp.fsf@wibble.ilmari.org> <87ildyqwks.fsf@wibble.ilmari.org> Date: Tue, 02 May 2023 11:48:43 +0100 In-Reply-To: (Michael Paquier's message of "Tue, 2 May 2023 11:09:59 +0900") Message-ID: <875y9buhys.fsf@wibble.ilmari.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Michael Paquier writes: > On Sat, Apr 15, 2023 at 11:06:25AM +0900, Michael Paquier wrote: >> Thanks, I'll look at it. > > + else if (Matches("CREATE", "SCHEMA", "AUTHORIZATION", MatchAny) || > + Matches("CREATE", "SCHEMA", MatchAny, "AUTHORIZATION", MatchAny)) > + COMPLETE_WITH("CREATE", "GRANT"); > + else if (Matches("CREATE", "SCHEMA", MatchAny)) > + COMPLETE_WITH("AUTHORIZATION", "CREATE", "GRANT"); > > I had this grammar under my eyes a few days ago for a different patch, > and there are much more objects types that can be appended to a CREATE > SCHEMA, like triggers, sequences, tables or views, so this is > incomplete, isn't it? This is for completing the word CREATE itself after CREATE SCHEMA [[] AUTHORIZATION] . The things that can come after that are already handled generically earlier in the function: /* CREATE */ /* complete with something you can create */ else if (TailMatches("CREATE")) matches = rl_completion_matches(text, create_command_generator); create_command_generator uses the words_after_create array, which lists all the things that can be created. - ilmari