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 1nW1tO-0003QX-Pw for pgsql-hackers@arkaria.postgresql.org; Sun, 20 Mar 2022 20:11:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nW1tN-00027q-M0 for pgsql-hackers@arkaria.postgresql.org; Sun, 20 Mar 2022 20:11:09 +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 1nW1tN-00027h-Cj for pgsql-hackers@lists.postgresql.org; Sun, 20 Mar 2022 20:11:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nW1tL-0006wn-8T for pgsql-hackers@lists.postgresql.org; Sun, 20 Mar 2022 20:11:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 22KKB3oJ1576632; Sun, 20 Mar 2022 16:11:03 -0400 From: Tom Lane To: =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= cc: pgsql-hackers@lists.postgresql.org Subject: Re: Tab completion for SET TimeZone In-reply-to: <877d8os8wh.fsf@wibble.ilmari.org> References: <87k0curq0w.fsf@wibble.ilmari.org> <87h77yrpsu.fsf@wibble.ilmari.org> <514658.1647438049@sss.pgh.pa.us> <87czikrtc1.fsf@wibble.ilmari.org> <87a6dnsgyr.fsf@wibble.ilmari.org> <1157472.1647629584@sss.pgh.pa.us> <877d8os8wh.fsf@wibble.ilmari.org> Comments: In-reply-to =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= message dated "Sun, 20 Mar 2022 19:47:58 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1576630.1647807063.1@sss.pgh.pa.us> Date: Sun, 20 Mar 2022 16:11:03 -0400 Message-ID: <1576631.1647807063@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= writes: > Tom Lane writes: >> I think the reason the COMPLETE_WITH_ENUM_VALUE macro doesn't look >> similar is that it hasn't made an attempt to work with input that >> the user didn't quote --- that is, if you type >> alter type planets rename value ur >> it just fails to match anything, instead of providing "'uranus'". >> Should we upgrade that likewise?` > The comment says it will add the quote before text if it's not there, so > maybe we should adjust that to say that it will only add the quote if > the user hasn't typed anything? After thinking a bit harder, I realized that the SchemaQuery infrastructure has no way to deal with the case of the input text not being a prefix of what we want the output to be, so it can't do something comparable to Query_for_list_of_timezone_names_quoted_out. Maybe someday we'll feel like adding that, but COMPLETE_WITH_ENUM_VALUE isn't a compelling enough reason in current usage. So I just tweaked the comment a bit. Pushed that way. regards, tom lane