Re: [PATCH]Feature improvement for MERGE tab completion

2022-09-15 Thread bt22kawamotok
Thanks for updating. + COMPLETE_WITH("UPDATE", "DELETE", "DO NOTHING"); "UPDATE" is always followed by "SET", so why not complement it with "UPDATE SET"? Thanks for reviewing. That's a good idea! I create new patch v7. Regards, Kotaro Kawamotodiff --git a/src/bin/psql/tab-comp

Re: [PATCH]Feature improvement for MERGE tab completion

2022-09-14 Thread bt22kawamotok
+ else if (TailMatches("MERGE", "INTO", MatchAny, "USING") || +TailMatches("MERGE", "INTO", MatchAny, MatchAny, "USING") || +TailMatches("MERGE", "INTO", MatchAny, "AS", MatchAny, "USING")) COMPLETE_WITH_SCHEMA_QUERY(Query_for

Re: Query jumbling for prepare statement

2022-09-14 Thread bt22kawamotok
2022-09-14 17:18 に Julien Rouhaud さんは書きました: Hi, On Wed, Sep 14, 2022 at 05:14:06PM +0900, bt22kawamotok wrote: I found prepare statement are not jumbled. Fro example PREPARE 't1'; and PREPARE 't2' are counted separately in pg_stat_statements. Are you talking about PREP

Query jumbling for prepare statement

2022-09-14 Thread bt22kawamotok
Hi! I found prepare statement are not jumbled. Fro example PREPARE 't1'; and PREPARE 't2' are counted separately in pg_stat_statements. I think it needs to be fixed. What do you think? Regards, Kotaro Kawamoto

Re: is_superuser is not documented

2022-09-13 Thread bt22kawamotok
Thanks for updating the patch! The patch looks good to me. - /* Not for general use --- used by SET SESSION AUTHORIZATION */ {"session_authorization", PGC_USERSET, UNGROUPED, If we don't document session_authorization and do expect that it's usually used by SET/SHO

Re: [PATCH]Feature improvement for MERGE tab completion

2022-09-13 Thread bt22kawamotok
When I tried to apply this patch, I got the following warning, please fix it. Other than that, I think everything is fine. $ git apply fix_tab_completion_merge_v4.patch fix_tab_completion_merge_v4.patch:38: trailing whitespace. else if (TailMatches("USING", MatchAny, "ON", MatchAny) || f

Re: is_superuser is not documented

2022-09-13 Thread bt22kawamotok
Thanks for the patch! + + is_superuser (boolean) You need to add this entry just after that of "in_hot_standby" because the descriptions of preset parameters should be placed in alphabetical order in the docs. + +Reports whether the user is superuser or not. Isn't

Re: Query Jumbling for CALL and SET utility statements

2022-09-12 Thread bt22kawamotok
Attached v5 to normalize 2PC commands too, so that we get things like: create table test_tx (a int); begin; prepare transaction 'tx1'; insert into test_tx values (1); commit prepared 'tx1'; begin; prepare transaction 'tx2'; insert into test_tx values (2); commit prepared 'tx2'; begin; prepare tr

Re: [PATCH]Feature improvement for MERGE tab completion

2022-09-12 Thread bt22kawamotok
Other than this correction, the parts that can be put together in OR were corrected in fix_tab_completion_merge_v4.patch. Kotaro Kawamotodiff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 62a39779b9..8b498f6a86 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql

Re: [PATCH]Feature improvement for MERGE tab completion

2022-09-12 Thread bt22kawamotok
Thanks for updating! Compile errors have occurred, so can you fix them? And I think we can eliminate similar redundancies in MERGE tab completion and I would like you to fix them. For example, else if (TailMatches("WHEN", "MATCHED")) COMPLETE_WITH("THEN", "AND");

Re: is_superuser is not documented

2022-09-12 Thread bt22kawamotok
On the other hand, it seems pretty silly that it's GUC_REPORT if we want to consider it private. I've not checked the git history, but I bet that flag was added later with no thought about context. If we are going to document this then we should at least remove the GUC_NO_SHOW_ALL flag and rewri

Re: [PATCH]Feature improvement for MERGE tab completion

2022-09-11 Thread bt22kawamotok
else if (TailMatches("USING", MatchAny, "ON", MatchAny, "WHEN")) COMPLETE_WITH("MATCHED", "NOT MATCHED"); else if (TailMatches("USING", MatchAny, "AS", MatchAny, "ON", MatchAny, "WHEN")) COMPLETE_WITH("MATCHED", "NOT MATCHED"); else if (TailMatches(

is_superuser is not documented

2022-09-08 Thread bt22kawamotok
Hi! is_superuser function checks whether a user is a superuser or not, and is commonly used. However, is_superuser is not documented and is set to UNGROUPED in guc.c. I think is_superuser should be added to the documentation and set to PRESET OPTIONS.What are you thought on this? Regards, Ko

[PATCH]Feature improvement for MERGE tab completion

2022-09-08 Thread bt22kawamotok
Hi! I created a patch for improving MARGE tab completion. Currently there is a problem with "MERGE INTO dst as d Using src as s ON d.key = s.key WHEN " is typed, "MATCHED" and "NOT MATCHED" is not completed. There is also a problem that typing "MERGE INTO a AS " completes "USING". This patch