Re: Tab completion for ATTACH PARTITION - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Tab completion for ATTACH PARTITION
Date
Msg-id 202309130719.b6zqtcf7tucp@alvherre.pgsql
Whole thread Raw
In response to Tab completion for ATTACH PARTITION  (bt23nguyent <bt23nguyent@oss.nttdata.com>)
Responses Re: Tab completion for ATTACH PARTITION
List 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)



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pg_upgrade and logical replication
Next
From: Alexander Kukushkin
Date:
Subject: Re: pg_rewind WAL segments deletion pitfall