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 1gaLJK-0000Y5-5t for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Dec 2018 13:57:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gaLJH-00075F-S2 for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Dec 2018 13:57:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gaLJH-00074R-He for pgsql-hackers@lists.postgresql.org; Fri, 21 Dec 2018 13:57:51 +0000 Received: from ping.uio.no ([2001:700:100:570::196]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gaLJE-0005ZW-J0 for pgsql-hackers@postgresql.org; Fri, 21 Dec 2018 13:57:50 +0000 Received: from [2001:700:100:570::211] (helo=dalvik.ping.uio.no ident=Debian-exim) by ping.uio.no with esmtp (Exim 4.72 #1 (Debian)) id 1gaLJ7-0005Pz-1d; Fri, 21 Dec 2018 14:57:42 +0100 Received: from ilmari by dalvik.ping.uio.no with local (Exim 4.84_2) (envelope-from ) id 1gaLJ6-0004wC-Sg; Fri, 21 Dec 2018 14:57:40 +0100 From: ilmari@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) To: Michael Paquier Cc: pgsql-hackers@postgresql.org Subject: Re: [PATCH] Improve tab completion for CREATE TABLE References: <20181219050530.GC19856@paquier.xyz> <20181219234408.GD27104@paquier.xyz> <20181220053352.GO27104@paquier.xyz> Mail-Copies-To: nobody Date: Fri, 21 Dec 2018 13:57:40 +0000 In-Reply-To: <20181220053352.GO27104@paquier.xyz> (Michael Paquier's message of "Thu, 20 Dec 2018 14:33:52 +0900") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Exiscan-Spam-Score: -3.7 (---) X-Exiscan-Spam-Report: SpamAssassin 3.3.1 (2010-03-16) on pike.ping.uio.no Score Rule * -5.0 PING_UIO_MAIL_IS_INTERNAL Message has never been outside * 129.240.0.0/16 or 193.157.115.0/24 * 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > On Thu, Dec 20, 2018 at 12:02:52AM +0000, Dagfinn Ilmari Mannsåker wrote: >> Point, fixed in the attached v4. OTOH, as I mentioned in my other >> email, that runs into the problem that it won't complete the actions >> after e.g. "CREATE TEMP TABLE FOO () WITH () ON COMMIT". > > I am fine to do that later on if that's adapted, one complication being > that the completion is dependent on the order of the clauses for CREATE > TABLE as we need something compatible with CREATE TABLE commands bundled > with CREATE SCHEMA calls so only tail checks can be done. Yeah, because of that we can't do the obvious HeadMatches("CREATE", "TABLE") && (TailMatches(...) || TailMatches(...) || ...). I believe this would require extending the match syntax with regex-like grouping, alternation and repetition operators, which I'm not volunteering to do. > So committed your last version after some comment tweaks and reordering > the entries in alphabetical order. Thanks! - ilmari -- "The surreality of the universe tends towards a maximum" -- Skud's Law "Never formulate a law or axiom that you're not prepared to live with the consequences of." -- Skud's Meta-Law