Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2019-01-27 Thread Tatsuro Yamada
Hi Michael, On 2019/01/28 15:31, Michael Paquier wrote: On Mon, Jan 28, 2019 at 02:18:25PM +0900, Tatsuro Yamada wrote: I modified the patch to handle the both: - quoted index names - complete partial numbers Committed, which should close the loop for this thread. If you have suggestio

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2019-01-27 Thread Michael Paquier
On Mon, Jan 28, 2019 at 02:18:25PM +0900, Tatsuro Yamada wrote: > I modified the patch to handle the both: > - quoted index names > - complete partial numbers Committed, which should close the loop for this thread. If you have suggestions for the documentation, maybe it would be better to sta

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2019-01-27 Thread Tatsuro Yamada
Hi Peter, On 2019/01/25 20:09, Peter Eisentraut wrote: 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 "\ +"

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2019-01-25 Thread Peter Eisentraut
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

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-12-25 Thread Tatsuro Yamada
On 2018/12/26 14:50, Tatsuro Yamada wrote: On 2018/12/26 14:15, Michael Paquier wrote: On Wed, Dec 26, 2018 at 02:05:26PM +0900, Tatsuro Yamada wrote: Do you mean my "fix_manual_of_alter_index_v2.patch"? Nope.  This patch is only a proposal for the documentation.  The main patch to extend psq

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-12-25 Thread Tatsuro Yamada
On 2018/12/26 14:15, Michael Paquier wrote: On Wed, Dec 26, 2018 at 02:05:26PM +0900, Tatsuro Yamada wrote: Do you mean my "fix_manual_of_alter_index_v2.patch"? Nope. This patch is only a proposal for the documentation. The main patch to extend psql completion so as column numbers are sugges

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-12-25 Thread Michael Paquier
On Wed, Dec 26, 2018 at 02:05:26PM +0900, Tatsuro Yamada wrote: > Do you mean my "fix_manual_of_alter_index_v2.patch"? Nope. This patch is only a proposal for the documentation. The main patch to extend psql completion so as column numbers are suggested fails to apply. -- Michael signature.asc

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-12-25 Thread Tatsuro Yamada
On 2018/12/26 13:50, Michael Paquier wrote: On Tue, Dec 25, 2018 at 02:27:03PM +0900, Michael Paquier wrote: Thanks, I have committed this one after making the logic to ignore column numbers a bit smarter, one problem being that "ALTER INDEX foo ALTER COLUMN" would try to suggest SET STATISTICS

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-12-25 Thread Tatsuro Yamada
On 2018/12/25 14:27, Michael Paquier wrote: On Tue, Dec 25, 2018 at 10:56:04AM +0900, Tatsuro Yamada wrote: Hmm... Okey, I agree. Why I implemented the exotic part of the feature is that it is for user-friendly. However, I suppose that user know the syntax because the syntax is used by an expe

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-12-25 Thread Michael Paquier
On Tue, Dec 25, 2018 at 02:27:03PM +0900, Michael Paquier wrote: > Thanks, I have committed this one after making the logic to ignore > column numbers a bit smarter, one problem being that "ALTER INDEX foo > ALTER COLUMN" would try to suggest SET STATISTICS directly, which is > incorrect. Instead

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-12-24 Thread Michael Paquier
On Tue, Dec 25, 2018 at 10:56:04AM +0900, Tatsuro Yamada wrote: > Hmm... Okey, I agree. Why I implemented the exotic part of the > feature is that it is for user-friendly. However, I suppose that > user know the syntax because the syntax is used by an expert user. Thanks, I have committed this

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-12-24 Thread Tatsuro Yamada
On 2018/12/21 16:13, Michael Paquier wrote: On Fri, Dec 21, 2018 at 02:51:51PM +0900, Tatsuro Yamada wrote: Attached file is a WIP patch. Before sorting out the exotic part of the feature, why not first fixing the simple cases where we know that tab completion is broken and can be improved? T

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-12-20 Thread Michael Paquier
On Fri, Dec 21, 2018 at 02:51:51PM +0900, Tatsuro Yamada wrote: > Attached file is a WIP patch. Before sorting out the exotic part of the feature, why not first fixing the simple cases where we know that tab completion is broken and can be improved? This is what I meant in this email: https://www

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-12-20 Thread Tatsuro Yamada
On 2018/12/20 10:47, Tatsuro Yamada wrote: On 2018/12/20 10:38, Michael Paquier wrote: On Thu, Dec 20, 2018 at 10:05:30AM +0900, Tatsuro Yamada wrote: Alright, I'll create new patches including these:    - No completion after "ALTER TABLE/INDEX SET STATISTICS" instead of schema names    - Com

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-12-19 Thread Tatsuro Yamada
On 2018/12/20 10:38, Michael Paquier wrote: On Thu, Dec 20, 2018 at 10:05:30AM +0900, Tatsuro Yamada wrote: Alright, I'll create new patches including these: - No completion after "ALTER TABLE/INDEX SET STATISTICS" instead of schema names - Complete "ALTER INDEX foo ALTER COLUMN SET" wit

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-12-19 Thread Michael Paquier
On Thu, Dec 20, 2018 at 10:05:30AM +0900, Tatsuro Yamada wrote: > Alright, I'll create new patches including these: > > - No completion after "ALTER TABLE/INDEX SET STATISTICS" instead of schema > names > - Complete "ALTER INDEX foo ALTER COLUMN SET" with STATISTICS by > using *column_numbe

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-12-19 Thread Tatsuro Yamada
On 2018/12/19 18:22, Michael Paquier wrote: On Wed, Dec 19, 2018 at 04:26:27PM +0900, Tatsuro Yamada wrote: Yep, I already did that for ALTER INDEX in tab_completion_alter_index_set_statistics.patch like this: + /* ALTER INDEX ALTER COLUMN SET STATISTICS */ + else if (HeadMatches("ALTER"

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-12-19 Thread Michael Paquier
On Wed, Dec 19, 2018 at 04:26:27PM +0900, Tatsuro Yamada wrote: > Yep, I already did that for ALTER INDEX in > tab_completion_alter_index_set_statistics.patch like this: > > + /* ALTER INDEX ALTER COLUMN SET STATISTICS */ > + else if (HeadMatches("ALTER", "INDEX") && TailMatches("SET", > "

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-12-18 Thread Tatsuro Yamada
On 2018/12/19 14:27, Michael Paquier wrote: On Tue, Dec 04, 2018 at 02:31:51PM +0900, Tatsuro Yamada wrote: - For now, there is no column_number column on "\d index_name" result. So, if tab-completion suggested column_numbers, user can't match these easily. Well, it depends how many

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-12-18 Thread Michael Paquier
On Tue, Dec 04, 2018 at 02:31:51PM +0900, Tatsuro Yamada wrote: > - For now, there is no column_number column on "\d index_name" result. >So, if tab-completion suggested column_numbers, user can't match >these easily. Well, it depends how many columns an index definition has. If that's o

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-12-03 Thread Tatsuro Yamada
At Wed, 28 Nov 2018 14:41:40 +0900, Tatsuro Yamada wrote in <54bd214b-d0d3-8654- * tab_completion_alter_index_set_statistics.patch === There are two problems. You can use these DDL before testing. #create table hoge (a integer, b integer); #create index ind_hoge on hoge (a, (a +

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-11-29 Thread Kyotaro HORIGUCHI
Hello. At Wed, 28 Nov 2018 14:41:40 +0900, Tatsuro Yamada wrote in <54bd214b-d0d3-8654-e71f-45e7b4f97...@lab.ntt.co.jp> > On 2018/11/28 13:14, Kyotaro HORIGUCHI wrote: > > Hello. > > At Wed, 28 Nov 2018 11:27:23 +0900, Tatsuro Yamada > > wrote in > > > >> Hi, > >> > >> On 2018/11/26 11:05, Ta

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-11-27 Thread Tatsuro Yamada
On 2018/11/28 13:14, Kyotaro HORIGUCHI wrote: Hello. At Wed, 28 Nov 2018 11:27:23 +0900, Tatsuro Yamada wrote in Hi, On 2018/11/26 11:05, Tatsuro Yamada wrote: I couldn't write patches details on previous email, so I write more explanation for that on this email. * tab_completion_alter_in

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-11-27 Thread Kyotaro HORIGUCHI
Hello. At Wed, 28 Nov 2018 11:27:23 +0900, Tatsuro Yamada wrote in > Hi, > > On 2018/11/26 11:05, Tatsuro Yamada wrote: > I couldn't write patches details on previous email, so I write > more explanation for that on this email. > > > * tab_completion_alter_index_set_statistics.patch > =

Re: Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-11-27 Thread Tatsuro Yamada
Hi, On 2018/11/26 11:05, Tatsuro Yamada wrote: Hi, Attached patches are following: * tab_completion_alter_index_set_statistics.patch     - Add column name completion after ALTER COLUMN     - Avoid schema completion after SET STATISTICS * fix_manual_of_alter_index.patch     - ALTER INDEX AL

Tab completion for ALTER INDEX|TABLE ALTER COLUMN SET STATISTICS

2018-11-25 Thread Tatsuro Yamada
Hi, Attached patches are following: * tab_completion_alter_index_set_statistics.patch - Add column name completion after ALTER COLUMN - Avoid schema completion after SET STATISTICS * fix_manual_of_alter_index.patch - ALTER INDEX ALTER COLUMN syntax is able to use not only colu