Re: Tab completion for ATTACH PARTITION

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: bt23nguyent <bt23nguyent(at)oss(dot)nttdata(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Tab completion for ATTACH PARTITION
Date: 2023-09-13 07:19:29
Message-ID: 202309130719.b6zqtcf7tucp@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2023-Sep-13, bt23nguyent wrote:

> Hi,
>
> Currently, the psql's tab completion feature does not support properly for
> ATTACH PARTITION. When <TAB> key is typed after "ALTER TABLE <table_name>
> ATTACH PARTITION ", all possible table names should be displayed, however,
> foreign table names are not displayed. So I created a patch that addresses
> this issue by ensuring that psql displays not only normal table names but
> also foreign table names in this case.

Sounds reasonable, but I think if we're going to have a specific query
for this case, we should make it a lot more precise. For example, any
relation that's already a partition cannot be attached; as can't any
relation that is involved in legacy inheritance as either parent or
child.

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"This is a foot just waiting to be shot" (Andrew Dunstan)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Kukushkin 2023-09-13 07:21:35 Re: pg_rewind WAL segments deletion pitfall
Previous Message Michael Paquier 2023-09-13 07:18:30 Re: pg_upgrade and logical replication