Re: psql suggestion "select <tab>" offers nothing, can we get functions like "\df <tab>"

From: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: Kirk Wolak <wolakk(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: psql suggestion "select <tab>" offers nothing, can we get functions like "\df <tab>"
Date: 2025-04-07 20:54:20
Message-ID: CAKAnmmJCBOVx5Y__7JFHqDv4-nkq_SdPkXGTsdcZwUda12twWQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Apr 7, 2025 at 12:55 PM Kirill Reshke <reshkekirill(at)gmail(dot)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

--
Crunchy Data - https://www.crunchydata.com
Enterprise Postgres Software Products & Tech Support

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jakub Wartak 2025-04-07 21:01:17 Re: Draft for basic NUMA observability
Previous Message Shayon Mukherjee 2025-04-07 20:47:56 Re: [PATCH] Re: Proposal to Enable/Disable Index using ALTER INDEX