agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
From: Erik Wienhold <ewie@ewie.name>
To: pgsql-hackers@lists.postgresql.org
Subject: psql: Fix \df tab completion for procedures
Date: Wed, 1 Jul 2026 21:36:23 +0200
Message-ID: <10fbfdfe-80f6-4ef9-b8b3-f7be0eb53a50@ewie.name> (raw)

Here's a patch that fixes the tab completion for \df to also consider
procedures, in effect every kind of routine.

I guess this was just missed in commits fb421231daa and 05e85d35afb.

-- 
Erik Wienhold
From 1be80c34cb53825a7f0e04a09b2e6c9b391103e3 Mon Sep 17 00:00:00 2001
From: Erik Wienhold <ewie@ewie.name>
Date: Sat, 22 Nov 2025 15:42:06 +0100
Subject: [PATCH v1] psql: Fix \df tab completion for procedures

\df also covers procedures since fb421231daa.  But the tab completion
logic was never changed to align with that.  Fix this along the lines of
05e85d35afb.
---
 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 072b98bea08..8f81f5bf035 100644
--- a/src/bin/psql/tab-complete.in.c
+++ b/src/bin/psql/tab-complete.in.c
@@ -5669,7 +5669,7 @@ match_previous_words(int pattern_id,
 	else if (TailMatchesCS("\\dew*"))
 		COMPLETE_WITH_QUERY(Query_for_list_of_fdws);
 	else if (TailMatchesCS("\\df*"))
-		COMPLETE_WITH_VERSIONED_SCHEMA_QUERY(Query_for_list_of_functions);
+		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_routines);
 	else if (HeadMatchesCS("\\df*"))
 		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_datatypes);
 
-- 
2.55.0

Attachments:

  [text/plain] v1-0001-psql-Fix-df-tab-completion-for-procedures.patch (1.0K, ../10fbfdfe-80f6-4ef9-b8b3-f7be0eb53a50@ewie.name/2-v1-0001-psql-Fix-df-tab-completion-for-procedures.patch)
  download | inline diff:
From 1be80c34cb53825a7f0e04a09b2e6c9b391103e3 Mon Sep 17 00:00:00 2001
From: Erik Wienhold <ewie@ewie.name>
Date: Sat, 22 Nov 2025 15:42:06 +0100
Subject: [PATCH v1] psql: Fix \df tab completion for procedures

\df also covers procedures since fb421231daa.  But the tab completion
logic was never changed to align with that.  Fix this along the lines of
05e85d35afb.
---
 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 072b98bea08..8f81f5bf035 100644
--- a/src/bin/psql/tab-complete.in.c
+++ b/src/bin/psql/tab-complete.in.c
@@ -5669,7 +5669,7 @@ match_previous_words(int pattern_id,
 	else if (TailMatchesCS("\\dew*"))
 		COMPLETE_WITH_QUERY(Query_for_list_of_fdws);
 	else if (TailMatchesCS("\\df*"))
-		COMPLETE_WITH_VERSIONED_SCHEMA_QUERY(Query_for_list_of_functions);
+		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_routines);
 	else if (HeadMatchesCS("\\df*"))
 		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_datatypes);
 
-- 
2.55.0

view thread (5+ messages)  latest in thread

Message-ID: <10fbfdfe-80f6-4ef9-b8b3-f7be0eb53a50@ewie.name>
Permalink:  ../10fbfdfe-80f6-4ef9-b8b3-f7be0eb53a50@ewie.name/
Also on:    postgresql.org/message-id/10fbfdfe-80f6-4ef9-b8b3-f7be0eb53a50@ewie.name

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: ewie@ewie.name, pgsql-hackers@lists.postgresql.org
  Subject: Re: psql: Fix \df tab completion for procedures
  In-Reply-To: <10fbfdfe-80f6-4ef9-b8b3-f7be0eb53a50@ewie.name>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox