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 1n7yCL-0001gZ-8K for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jan 2022 11:23:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n7yCK-0002jK-1P for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jan 2022 11:23:16 +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 1n7yCJ-0002jB-1g for pgsql-hackers@lists.postgresql.org; Thu, 13 Jan 2022 11:23:15 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n7yCE-0002n5-4l for pgsql-hackers@postgresql.org; Thu, 13 Jan 2022 11:23:14 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 8C7BB3201D51 for ; Thu, 13 Jan 2022 06:23:05 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 13 Jan 2022 06:23:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=LW0tVg oJH3iknRpY+KpJNz5LleMiOOoN66DN96niH24=; b=Dxd8Ur0yjkwqCTa71GZqXf xvq6mVPAIEQKqgHxmanYlOjkdo/b/uaGbvzjfVyBU3//2DU2QMxlJdMV8f19E+LY l5X4Yj6c33zc9AUx+3K6CQZWCCrosX5W23wP2bV4zr3XUT1sH6zIoilKBs4QpOWD vfJjlrfMqt10zmq1sKMzv/+gsfvqtC5mnv3KL6WdjMh1Rf1B2SlKVC6bNMedPWjw 7j7nOlgIeM++BRo5sbi7Qa6UQAd7+gHtQM7jRDeCH2BTqjX547sbPCLCjeN/fcmo lqgCjfX8bmZW+XYs01sMh7gb+4ZAzeSc+G7+/L66qdt+FT5d0mAIPin/8mH+ckyA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrtdefgddviecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfhffuvfgtgfesthejredttd efjeenucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghi shgvnhhtrhgruhhtsegvnhhtvghrphhrihhsvggusgdrtghomheqnecuggftrfgrthhtvg hrnhepieejueevgefhieettedtgedtvefhvdeludelveevgeelvedtleeuheetvefftdeu necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvth gvrhdrvghishgvnhhtrhgruhhtsegvnhhtvghrphhrihhsvggusgdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 13 Jan 2022 06:23:04 -0500 (EST) Message-ID: <8ca82d89-ec3d-8b28-8291-500efaf23b25@enterprisedb.com> Date: Thu, 13 Jan 2022 12:23:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Content-Language: en-US From: Peter Eisentraut Subject: tab completion of enum values is broken To: pgsql-hackers Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This doesn't work anymore: create type e2 as enum ('foo', 'bar'); alter type e2 rename value 'b This now results in alter type e2 rename value 'b' Bisecting blames commit cd69ec66c88633c09bc9a984a7f0930e09c7c96e Author: Tom Lane Date: Thu Jan 23 11:07:12 2020 -0500 Improve psql's tab completion for filenames. which did deal with quoting of things to be completed, so it seems very plausible to be some collateral damage. The queries issued by the completion engine are bad LOG: statement: SELECT pg_catalog.quote_literal(enumlabel) FROM pg_catalog.pg_enum e, pg_catalog.pg_type t WHERE t.oid = e.enumtypid AND substring(pg_catalog.quote_literal(enumlabel),1,1)='b' AND (pg_catalog.quote_ident(typname)='e2' OR '"' || typname || '"'='e2') AND pg_catalog.pg_type_is_visible(t.oid) LIMIT 1000 good LOG: statement: SELECT pg_catalog.quote_literal(enumlabel) FROM pg_catalog.pg_enum e, pg_catalog.pg_type t WHERE t.oid = e.enumtypid AND substring(pg_catalog.quote_literal(enumlabel),1,2)='''b' AND (pg_catalog.quote_ident(typname)='e2' OR '"' || typname || '"'='e2') AND pg_catalog.pg_type_is_visible(t.oid) LIMIT 1000 I tried quickly fiddling with the substring() call to correct for the changed offset somehow, but didn't succeed. Needs more analysis.