From 636480ae39938355afefd3b592690881ddfce00d Mon Sep 17 00:00:00 2001
From: Shubh Mehta <shubhmehta942@gmail.com>
Date: Sun, 6 Dec 2026 18:18:45 +0530
Subject: [PATCH v2 2/2] psql: Keep schema name when completing DROP CONVERSION

The CONVERSION entry in words_after_create used a plain query on
conname, so a schema-qualified name lost its schema part, e.g.
"DROP CONVERSION myschema.sec<TAB>" became "DROP CONVERSION
secret_conversion".  Use Query_for_list_of_conversions instead, like
COLLATION and other schema-qualified objects.
---
 src/bin/psql/tab-complete.in.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/psql/tab-complete.in.c b/src/bin/psql/tab-complete.in.c
index 0d4bc1f..606ed0a 100644
--- a/src/bin/psql/tab-complete.in.c
+++ b/src/bin/psql/tab-complete.in.c
@@ -1308,7 +1308,7 @@ static const pgsql_thing_t words_after_create[] = {
 	 * to be used only by pg_dump.
 	 */
 	{"CONFIGURATION", NULL, NULL, &Query_for_list_of_ts_configurations, NULL, THING_NO_SHOW},
-	{"CONVERSION", "SELECT conname FROM pg_catalog.pg_conversion WHERE conname LIKE '%s'"},
+	{"CONVERSION", NULL, NULL, &Query_for_list_of_conversions},
 	{"DATABASE", Query_for_list_of_databases},
 	{"DEFAULT PRIVILEGES", NULL, NULL, NULL, NULL, THING_NO_CREATE | THING_NO_DROP},
 	{"DICTIONARY", NULL, NULL, &Query_for_list_of_ts_dictionaries, NULL, THING_NO_SHOW},
-- 
2.53.0

