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 1ifm9M-0003X2-Uy for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Dec 2019 14:42:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ifm9L-0005qT-JM for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Dec 2019 14:42:35 +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 1ifm9L-0005qL-7b for pgsql-hackers@lists.postgresql.org; Fri, 13 Dec 2019 14:42:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ifm9H-00050x-1C for pgsql-hackers@lists.postgresql.org; Fri, 13 Dec 2019 14:42:32 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xBDEgPi9023609; Fri, 13 Dec 2019 09:42:26 -0500 From: Tom Lane To: Alvaro Herrera cc: pgsql-hackers@lists.postgresql.org, steven.winfield@cantabcapital.com Subject: Re: BUG #16059: Tab-completion of filenames in COPY commands removes required quotes In-reply-to: <4158.1576129790@sss.pgh.pa.us> References: <20191211015552.GA6301@alvherre.pgsql> <17796.1576082603@sss.pgh.pa.us> <4158.1576129790@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Thu, 12 Dec 2019 00:49:50 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23607.1576248145.1@sss.pgh.pa.us> Date: Fri, 13 Dec 2019 09:42:25 -0500 Message-ID: <23608.1576248145@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: >> Alvaro Herrera writes: >>> I don't quite understand why a readline library that doesn't have >>> rl_filename_completion_function is known to have a >>> filename_completion_function, ie. this bit >>> #ifdef HAVE_RL_FILENAME_COMPLETION_FUNCTION >>> #define filename_completion_function rl_filename_completion_function >>> #else >>> /* decl missing in some header files, but function exists anyway */ >>> extern char *filename_completion_function(); >>> #endif >> I think the point is that before rl_filename_completion_function the >> function existed but was just called filename_completion_function. >> It's possible that that's obsolete --- I've not really checked. Looking closer at this, the "extern" could be got rid of, I think. prairiedog's readline header does have that extern, so it's hard to believe anybody is still using libedit versions that don't declare it. A possible further change is to switch the code over to calling "rl_filename_completion_function", and then invert the sense of this logic, like /* * Ancient versions of libedit provide filename_completion_function() * instead of rl_filename_completion_function(). */ #ifndef HAVE_RL_FILENAME_COMPLETION_FUNCTION #define rl_filename_completion_function filename_completion_function #endif This would make it easier to compare our code to the readline documentation, so maybe it's helpful ... or maybe it's just churn. Thoughts? regards, tom lane