@@ -737,6 +737,11 @@ static const SchemaQuery Query_for_list_of_matviews = {
737
737
" FROM pg_catalog.pg_event_trigger "\
738
738
" WHERE substring(pg_catalog.quote_ident(evtname),1,%d)='%s'"
739
739
740
+ #define Query_for_list_of_tablesample_methods \
741
+ " SELECT pg_catalog.quote_ident(tsmname) "\
742
+ " FROM pg_catalog.pg_tablesample_method "\
743
+ " WHERE substring(pg_catalog.quote_ident(tsmname),1,%d)='%s'"
744
+
740
745
/*
741
746
* This is a list of all "things" in Pgsql, which can show up after CREATE or
742
747
* DROP; and there is also a query to get a list of them.
@@ -3580,6 +3585,13 @@ psql_completion(const char *text, int start, int end)
3580
3585
prev2_wd [0 ]== '\0' )
3581
3586
COMPLETE_WITH_SCHEMA_QUERY (Query_for_list_of_relations ,NULL );
3582
3587
3588
+ /* TABLESAMPLE */
3589
+ else if (pg_strcasecmp (prev_wd ,"TABLESAMPLE" )== 0 )
3590
+ COMPLETE_WITH_QUERY (Query_for_list_of_tablesample_methods );
3591
+
3592
+ else if (pg_strcasecmp (prev2_wd ,"TABLESAMPLE" )== 0 )
3593
+ COMPLETE_WITH_CONST ("(" );
3594
+
3583
3595
/* TRUNCATE */
3584
3596
else if (pg_strcasecmp (prev_wd ,"TRUNCATE" )== 0 )
3585
3597
COMPLETE_WITH_SCHEMA_QUERY (Query_for_list_of_tables ,NULL );