Re: psql suggestion "select " offers nothing, can we get functions like "\df "
От | Greg Sabino Mullane |
---|---|
Тема | Re: psql suggestion "select |
Дата | |
Msg-id | CAKAnmmJCBOVx5Y__7JFHqDv4-nkq_SdPkXGTsdcZwUda12twWQ@mail.gmail.com обсуждение исходный текст |
Ответ на |
Re: psql suggestion "select |
Список | 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
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
В списке pgsql-hackers по дате отправления: