| From: | Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com> | 
|---|---|
| To: | Justin Pryzby <pryzby(at)telsasoft(dot)com> | 
| Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | Re: [PATCH] Tab completion for VACUUM of partitioned tables | 
| Date: | 2020-07-29 04:27:07 | 
| Message-ID: | CA+fd4k5iZAwRP=t6twph-8CgGL88yUZei2QU_jY754-3MAfgTQ@mail.gmail.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
On Wed, 29 Jul 2020 at 02:04, Justin Pryzby <pryzby(at)telsasoft(dot)com> wrote:
>
> Could maybe backpatch to v10.
>
> diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
> index 272f799c24..06ef658afb 100644
> --- a/src/bin/psql/tab-complete.c
> +++ b/src/bin/psql/tab-complete.c
> @@ -578,14 +578,23 @@ static const SchemaQuery Query_for_list_of_vacuumables = {
>         .catname = "pg_catalog.pg_class c",
>         .selcondition =
>         "c.relkind IN (" CppAsString2(RELKIND_RELATION) ", "
> +       CppAsString2(RELKIND_PARTITIONED_TABLE) ", "
>         CppAsString2(RELKIND_MATVIEW) ")",
>         .viscondition = "pg_catalog.pg_table_is_visible(c.oid)",
>         .namespace = "c.relnamespace",
>         .result = "pg_catalog.quote_ident(c.relname)",
>  };
>
> -/* Relations supporting CLUSTER are currently same as those supporting VACUUM */
> -#define Query_for_list_of_clusterables Query_for_list_of_vacuumables
> +/* Relations supporting CLUSTER */
> +static const SchemaQuery Query_for_list_of_clusterables = {
> +       .catname = "pg_catalog.pg_class c",
> +       .selcondition =
> +       "c.relkind IN (" CppAsString2(RELKIND_RELATION) ", "
> +       CppAsString2(RELKIND_MATVIEW) ")",
> +       .viscondition = "pg_catalog.pg_table_is_visible(c.oid)",
> +       .namespace = "c.relnamespace",
> +       .result = "pg_catalog.quote_ident(c.relname)",
> +};
>
>  static const SchemaQuery Query_for_list_of_constraints_with_schema = {
>         .catname = "pg_catalog.pg_constraint c",
Good catch. The patch looks good to me.
Regards,
-- 
Masahiko Sawada            http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ashutosh Sharma | 2020-07-29 04:28:08 | Re: recovering from "found xmin ... from before relfrozenxid ..." | 
| Previous Message | Hamid Akhtar | 2020-07-29 04:13:19 | Re: Rethinking opclass member checks and dependency strength |