Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS
От | Peter Eisentraut |
---|---|
Тема | Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS |
Дата | |
Msg-id | 390d20e9-1267-8146-f517-36469f0b9907@2ndquadrant.com обсуждение исходный текст |
Ответ на | Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS (Tatsuro Yamada <yamada.tatsuro@lab.ntt.co.jp>) |
Ответы |
Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS
|
Список | pgsql-hackers |
On 26/12/2018 07:07, Tatsuro Yamada wrote: > +#define Query_for_list_of_attribute_numbers \ > +"SELECT attnum "\ > +" FROM pg_catalog.pg_attribute a, "\ > +" pg_catalog.pg_class c "\ > +" WHERE c.oid = a.attrelid "\ > +" AND a.attnum > 0 "\ > +" AND NOT a.attisdropped "\ > +" /* %d %s */" \ > +" AND a.attrelid = (select oid from pg_catalog.pg_class where relname = '%s') "\ > +" AND pg_catalog.pg_table_is_visible(c.oid) "\ > +"order by a.attnum asc " This needs a bit of refinement. You need to handle quoted index names (see nearby Query_for_list_of_attributes), and you should also complete partial numbers (e.g., if I type 1 then complete 10, 11, ... if appropriate). -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-hackers по дате отправления: