aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/tab-complete.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql/tab-complete.c')
-rw-r--r--src/bin/psql/tab-complete.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 9596af6a7b3..ece05155490 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -738,13 +738,15 @@ static const SchemaQuery Query_for_list_of_matviews = {
" WHERE substring(pg_catalog.quote_ident(evtname),1,%d)='%s'"
#define Query_for_list_of_tablesample_methods \
-" SELECT pg_catalog.quote_ident(tsmname) "\
-" FROM pg_catalog.pg_tablesample_method "\
-" WHERE substring(pg_catalog.quote_ident(tsmname),1,%d)='%s'"
+" SELECT pg_catalog.quote_ident(proname) "\
+" FROM pg_catalog.pg_proc "\
+" WHERE prorettype = 'pg_catalog.tsm_handler'::pg_catalog.regtype AND "\
+" proargtypes[0] = 'pg_catalog.internal'::pg_catalog.regtype AND "\
+" substring(pg_catalog.quote_ident(proname),1,%d)='%s'"
#define Query_for_list_of_policies \
" SELECT pg_catalog.quote_ident(polname) "\
-" FROM pg_catalog.pg_policy " \
+" FROM pg_catalog.pg_policy "\
" WHERE substring(pg_catalog.quote_ident(polname),1,%d)='%s'"
#define Query_for_list_of_tables_for_policy \