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)