Re: psql suggestion "select " offers nothing, can we get functions like "\df " - Mailing list pgsql-hackers

From Greg Sabino Mullane
Subject Re: psql suggestion "select " offers nothing, can we get functions like "\df "
Date
Msg-id CAKAnmmJCBOVx5Y__7JFHqDv4-nkq_SdPkXGTsdcZwUda12twWQ@mail.gmail.com
Whole thread Raw
In response to Re: psql suggestion "select " offers nothing, can we get functions like "\df "  (Kirill Reshke <reshkekirill@gmail.com>)
List pgsql-hackers
On Mon, Apr 7, 2025 at 12:55 PM Kirill Reshke <reshkekirill@gmail.com> wrote:
Maybe we can tab-complete here if prefix matches pg_% ? Does that makes good use case?

I think you will have to get much more specific than pg_ before tab completion makes sense. You are still looking at hundreds of answers. The example upthread could benefit from tab completion (pg_stat_st<TAB>) but where does one programmatically draw the line? (digs around). Looks like pg_<single-letter><TAB> could be useful - while pg_s has ~ 150 entries, everything else is doable:

greg=# with alpha as (select chr(x) from generate_series(97,122) x)
select chr, count(*) from pg_proc, alpha where proname ~ ('pg_'||chr) group by 1 order by 1;
 chr | count
-----+-------
 a   |    17
 b   |    15
 c   |    43
 d   |    14
 e   |    11
 f   |     4
 g   |    41
 h   |     7
 i   |    18
 j   |     1
 k   |     4
 l   |    46
 m   |     6
 n   |    14
 o   |     4
 p   |     9
 q   |     5
 r   |    35
 s   |   150
 t   |    38
 v   |     6
 w   |     6
 x   |     3

--
Cheers,
Greg

--
Enterprise Postgres Software Products & Tech Support

pgsql-hackers by date:

Previous
From: Shayon Mukherjee
Date:
Subject: Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX
Next
From: Jakub Wartak
Date:
Subject: Re: Draft for basic NUMA observability