pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed(LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
12+ messages / 4 participants
[nested] [flat]
Commits from this thread:
2021-10-05 0b0d277c35 psql: Improve tab-completion for LOCK TABLE.
* (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
@ 2021-09-28 07:13 bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 07:36 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Fujii Masao <masao.fujii@oss.nttdata.com>
0 siblings, 1 reply; 12+ messages in thread
From: bt21tanigaway @ 2021-09-28 07:13 UTC (permalink / raw)
To: pgsql-hackers@lists.postgresql.org
Hi,
(LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented in
tab-complete. I made a patch for these options.
regards,
Koyu Tanigawa
Attachments:
fix-tab-complete.patch (text/x-diff, 3.2K) download
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 5cd5838668..12c55f5904 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -3599,39 +3599,49 @@ psql_completion(const char *text, int start, int end)
COMPLETE_WITH("(");
/* LOCK */
- /* Complete LOCK [TABLE] with a list of tables */
+ /* Complete LOCK [TABLE] [ONLY] with a list of tables */
else if (Matches("LOCK"))
- COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,
- " UNION SELECT 'TABLE'");
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, " UNION SELECT 'TABLE'" " UNION SELECT 'ONLY'");
+
else if (Matches("LOCK", "TABLE"))
- COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, "");
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, " UNION SELECT 'ONLY'");
+ else if (Matches("LOCK", "TABLE", "ONLY") || Matches("LOCK", "ONLY"))
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, "");
/* For the following, handle the case of a single table only for now */
- /* Complete LOCK [TABLE] <table> with "IN" */
- else if (Matches("LOCK", MatchAnyExcept("TABLE")) ||
- Matches("LOCK", "TABLE", MatchAny))
- COMPLETE_WITH("IN");
+ /* Complete LOCK [TABLE] [ONLY] <table> with "IN" or "NOWAIT" */
+ else if (Matches("LOCK", MatchAnyExcept("TABLE|ONLY")) ||
+ Matches("LOCK", "TABLE", MatchAnyExcept("ONLY")) ||
+ Matches("LOCK", "ONLY", MatchAny) ||
+ Matches("LOCK", "TABLE", "ONLY", MatchAny))
+ COMPLETE_WITH("IN", "NOWAIT");
- /* Complete LOCK [TABLE] <table> IN with a lock mode */
+ /* Complete LOCK [TABLE] [ONLY] <table> IN with a lock mode */
else if (Matches("LOCK", MatchAny, "IN") ||
- Matches("LOCK", "TABLE", MatchAny, "IN"))
+ Matches("LOCK", "TABLE", MatchAny, "IN") ||
+ Matches("LOCK", "TABLE", "ONLY", MatchAny, "IN"))
COMPLETE_WITH("ACCESS SHARE MODE",
"ROW SHARE MODE", "ROW EXCLUSIVE MODE",
"SHARE UPDATE EXCLUSIVE MODE", "SHARE MODE",
"SHARE ROW EXCLUSIVE MODE",
"EXCLUSIVE MODE", "ACCESS EXCLUSIVE MODE");
- /* Complete LOCK [TABLE] <table> IN ACCESS|ROW with rest of lock mode */
+ /* Complete LOCK [TABLE][ONLY] <table> IN ACCESS|ROW with rest of lock mode */
else if (Matches("LOCK", MatchAny, "IN", "ACCESS|ROW") ||
- Matches("LOCK", "TABLE", MatchAny, "IN", "ACCESS|ROW"))
+ Matches("LOCK", "TABLE", MatchAny, "IN", "ACCESS|ROW") ||
+ Matches("LOCK", "TABLE", "ONLY", MatchAny, "IN", "ACCESS|ROW"))
COMPLETE_WITH("EXCLUSIVE MODE", "SHARE MODE");
- /* Complete LOCK [TABLE] <table> IN SHARE with rest of lock mode */
+ /* Complete LOCK [TABLE] [ONLY] <table> IN SHARE with rest of lock mode */
else if (Matches("LOCK", MatchAny, "IN", "SHARE") ||
- Matches("LOCK", "TABLE", MatchAny, "IN", "SHARE"))
- COMPLETE_WITH("MODE", "ROW EXCLUSIVE MODE",
- "UPDATE EXCLUSIVE MODE");
+ Matches("LOCK", "TABLE", MatchAny, "IN", "SHARE") ||
+ Matches("LOCK", "TABLE", "ONLY", MatchAny, "IN", "SHARE"))
+ COMPLETE_WITH("MODE", "ROW EXCLUSIVE MODE", "UPDATE EXCLUSIVE MODE");
+
+ /* Complete LOCK [TABLE] [ONLY] <table> [IN lockmode MODE] with "NOWAIT"*/
+ else if (HeadMatches("LOCK") && TailMatches("MODE"))
+ COMPLETE_WITH("NOWAIT");
/* NOTIFY --- can be inside EXPLAIN, RULE, etc */
else if (TailMatches("NOTIFY"))
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
2021-09-28 07:13 (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
@ 2021-09-28 07:36 ` Fujii Masao <masao.fujii@oss.nttdata.com>
2021-09-28 08:03 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
0 siblings, 1 reply; 12+ messages in thread
From: Fujii Masao @ 2021-09-28 07:36 UTC (permalink / raw)
To: bt21tanigaway <bt21tanigaway@oss.nttdata.com>; pgsql-hackers@lists.postgresql.org
On 2021/09/28 16:13, bt21tanigaway wrote:
> Hi,
>
> (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented in tab-complete. I made a patch for these options.
Thanks for the patch!
The patch seems to forget to handle the tab-completion for
"LOCK ONLY <table-name> IN".
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
2021-09-28 07:13 (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 07:36 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Fujii Masao <masao.fujii@oss.nttdata.com>
@ 2021-09-28 08:03 ` bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 08:06 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
0 siblings, 1 reply; 12+ messages in thread
From: bt21tanigaway @ 2021-09-28 08:03 UTC (permalink / raw)
To: Fujii Masao <masao.fujii@oss.nttdata.com>; pgsql-hackers@lists.postgresql.org
2021-09-28 16:36 に Fujii Masao さんは書きました:
> On 2021/09/28 16:13, bt21tanigaway wrote:
>> Hi,
>>
>> (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented in
>> tab-complete. I made a patch for these options.
>
> Thanks for the patch!
> The patch seems to forget to handle the tab-completion for
> "LOCK ONLY <table-name> IN".
Thanks for your comment!
I attach a new patch fixed to this mail.
Regards,
Koyu Tanigawa
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
2021-09-28 07:13 (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 07:36 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Fujii Masao <masao.fujii@oss.nttdata.com>
2021-09-28 08:03 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
@ 2021-09-28 08:06 ` bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 13:46 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Shinya Kato <katousnk@oss.nttdata.com>
2021-09-28 13:55 ` RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Shinya11.Kato@nttdata.com
0 siblings, 2 replies; 12+ messages in thread
From: bt21tanigaway @ 2021-09-28 08:06 UTC (permalink / raw)
To: Fujii Masao <masao.fujii@oss.nttdata.com>; pgsql-hackers@lists.postgresql.org
2021-09-28 17:03 に bt21tanigaway さんは書きました:
> 2021-09-28 16:36 に Fujii Masao さんは書きました:
>> On 2021/09/28 16:13, bt21tanigaway wrote:
>>> Hi,
>>>
>>> (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented in
>>> tab-complete. I made a patch for these options.
>>
>> Thanks for the patch!
>> The patch seems to forget to handle the tab-completion for
>> "LOCK ONLY <table-name> IN".
>
> Thanks for your comment!
> I attach a new patch fixed to this mail.
>
> Regards,
>
> Koyu Tanigawa
Sorry, I forgot to attach patch file.
"fix-tab-complete2.patch" is fixed!
Regards,
Koyu Tanigawa
Attachments:
fix-tab-complete2.patch (text/x-diff, 3.4K) download
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 5cd5838668..251b2af9a5 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -3599,39 +3599,52 @@ psql_completion(const char *text, int start, int end)
COMPLETE_WITH("(");
/* LOCK */
- /* Complete LOCK [TABLE] with a list of tables */
+ /* Complete LOCK [TABLE] [ONLY] with a list of tables */
else if (Matches("LOCK"))
- COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,
- " UNION SELECT 'TABLE'");
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, " UNION SELECT 'TABLE'" " UNION SELECT 'ONLY'");
+
else if (Matches("LOCK", "TABLE"))
- COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, "");
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, " UNION SELECT 'ONLY'");
+ else if (Matches("LOCK", "TABLE", "ONLY") || Matches("LOCK", "ONLY"))
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, "");
/* For the following, handle the case of a single table only for now */
- /* Complete LOCK [TABLE] <table> with "IN" */
- else if (Matches("LOCK", MatchAnyExcept("TABLE")) ||
- Matches("LOCK", "TABLE", MatchAny))
- COMPLETE_WITH("IN");
+ /* Complete LOCK [TABLE] [ONLY] <table> with "IN" or "NOWAIT" */
+ else if (Matches("LOCK", MatchAnyExcept("TABLE|ONLY")) ||
+ Matches("LOCK", "TABLE", MatchAnyExcept("ONLY")) ||
+ Matches("LOCK", "ONLY", MatchAny) ||
+ Matches("LOCK", "TABLE", "ONLY", MatchAny))
+ COMPLETE_WITH("IN", "NOWAIT");
- /* Complete LOCK [TABLE] <table> IN with a lock mode */
+ /* Complete LOCK [TABLE] [ONLY] <table> IN with a lock mode */
else if (Matches("LOCK", MatchAny, "IN") ||
- Matches("LOCK", "TABLE", MatchAny, "IN"))
+ Matches("LOCK", "TABLE", MatchAny, "IN") ||
+ Matches("LOCK", "ONLY", MatchAny, "IN") ||
+ Matches("LOCK", "TABLE", "ONLY", MatchAny, "IN"))
COMPLETE_WITH("ACCESS SHARE MODE",
"ROW SHARE MODE", "ROW EXCLUSIVE MODE",
"SHARE UPDATE EXCLUSIVE MODE", "SHARE MODE",
"SHARE ROW EXCLUSIVE MODE",
"EXCLUSIVE MODE", "ACCESS EXCLUSIVE MODE");
- /* Complete LOCK [TABLE] <table> IN ACCESS|ROW with rest of lock mode */
+ /* Complete LOCK [TABLE][ONLY] <table> IN ACCESS|ROW with rest of lock mode */
else if (Matches("LOCK", MatchAny, "IN", "ACCESS|ROW") ||
- Matches("LOCK", "TABLE", MatchAny, "IN", "ACCESS|ROW"))
+ Matches("LOCK", "TABLE", MatchAny, "IN", "ACCESS|ROW") ||
+ Matches("LOCK", "ONLY", MatchAny, "IN", "ACCESS|ROW") ||
+ Matches("LOCK", "TABLE", "ONLY", MatchAny, "IN", "ACCESS|ROW"))
COMPLETE_WITH("EXCLUSIVE MODE", "SHARE MODE");
- /* Complete LOCK [TABLE] <table> IN SHARE with rest of lock mode */
+ /* Complete LOCK [TABLE] [ONLY] <table> IN SHARE with rest of lock mode */
else if (Matches("LOCK", MatchAny, "IN", "SHARE") ||
- Matches("LOCK", "TABLE", MatchAny, "IN", "SHARE"))
- COMPLETE_WITH("MODE", "ROW EXCLUSIVE MODE",
- "UPDATE EXCLUSIVE MODE");
+ Matches("LOCK", "TABLE", MatchAny, "IN", "SHARE") ||
+ Matches("LOCK", "ONLY", MatchAny, "IN", "SHARE") ||
+ Matches("LOCK", "TABLE", "ONLY", MatchAny, "IN", "SHARE"))
+ COMPLETE_WITH("MODE", "ROW EXCLUSIVE MODE", "UPDATE EXCLUSIVE MODE");
+
+ /* Complete LOCK [TABLE] [ONLY] <table> [IN lockmode MODE] with "NOWAIT"*/
+ else if (HeadMatches("LOCK") && TailMatches("MODE"))
+ COMPLETE_WITH("NOWAIT");
/* NOTIFY --- can be inside EXPLAIN, RULE, etc */
else if (TailMatches("NOTIFY"))
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
2021-09-28 07:13 (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 07:36 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Fujii Masao <masao.fujii@oss.nttdata.com>
2021-09-28 08:03 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 08:06 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
@ 2021-09-28 13:46 ` Shinya Kato <katousnk@oss.nttdata.com>
1 sibling, 0 replies; 12+ messages in thread
From: Shinya Kato @ 2021-09-28 13:46 UTC (permalink / raw)
To: bt21tanigaway <bt21tanigaway@oss.nttdata.com>; +Cc: Fujii Masao <masao.fujii@oss.nttdata.com>; pgsql-hackers@lists.postgresql.org; Shinya11.Kato@nttdata.com
2021-09-28 17:06 に bt21tanigaway さんは書きました:
> 2021-09-28 17:03 に bt21tanigaway さんは書きました:
>> 2021-09-28 16:36 に Fujii Masao さんは書きました:
>>> On 2021/09/28 16:13, bt21tanigaway wrote:
>>>> Hi,
>>>>
>>>> (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented in
>>>> tab-complete. I made a patch for these options.
>>>
>>> Thanks for the patch!
>>> The patch seems to forget to handle the tab-completion for
>>> "LOCK ONLY <table-name> IN".
>>
>> Thanks for your comment!
>> I attach a new patch fixed to this mail.
>>
>> Regards,
>>
>> Koyu Tanigawa
>
> Sorry, I forgot to attach patch file.
> "fix-tab-complete2.patch" is fixed!
>
> Regards,
>
> Koyu Tanigawa
Thank you for your patch.
I have two comments.
1. When I executed git apply, an error occured.
---
$ git apply ~/Downloads/fix-tab-complete2.patch
/home/penguin/Downloads/fix-tab-complete2.patch:14: indent with spaces.
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, " UNION SELECT
'TABLE'" " UNION SELECT 'ONLY'");
warning: 1 line adds whitespace errors.
---
2. The command "LOCK TABLE a, b;" can be executed, but tab-completion
doesn't work properly. Is it OK?
--
Regards,
--
Shinya Kato
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
^ permalink raw reply [nested|flat] 12+ messages in thread
* RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
2021-09-28 07:13 (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 07:36 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Fujii Masao <masao.fujii@oss.nttdata.com>
2021-09-28 08:03 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 08:06 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
@ 2021-09-28 13:55 ` Shinya11.Kato@nttdata.com
2021-09-29 04:54 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
1 sibling, 1 reply; 12+ messages in thread
From: Shinya11.Kato@nttdata.com @ 2021-09-28 13:55 UTC (permalink / raw)
To: bt21tanigaway@oss.nttdata.com; masao.fujii@oss.nttdata.com; pgsql-hackers@lists.postgresql.org
>-----Original Message-----
>From: bt21tanigaway <bt21tanigaway@oss.nttdata.com>
>Sent: Tuesday, September 28, 2021 5:06 PM
>To: Fujii Masao <masao.fujii@oss.nttdata.com>;
>pgsql-hackers@lists.postgresql.org
>Subject: Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet
>implemented
>
>2021-09-28 17:03 に bt21tanigaway さんは書きました:
>> 2021-09-28 16:36 に Fujii Masao さんは書きました:
>>> On 2021/09/28 16:13, bt21tanigaway wrote:
>>>> Hi,
>>>>
>>>> (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented in
>>>> tab-complete. I made a patch for these options.
>>>
>>> Thanks for the patch!
>>> The patch seems to forget to handle the tab-completion for "LOCK ONLY
>>> <table-name> IN".
>>
>> Thanks for your comment!
>> I attach a new patch fixed to this mail.
>>
>> Regards,
>>
>> Koyu Tanigawa
>
>Sorry, I forgot to attach patch file.
>"fix-tab-complete2.patch" is fixed!
>
>Regards,
>
>Koyu Tanigawa
Thank you for your patch.
I have two comments.
1. When I executed git apply, an error occured.
---
$ git apply ~/Downloads/fix-tab-complete2.patch
/home/penguin/Downloads/fix-tab-complete2.patch:14: indent with spaces.
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, " UNION SELECT 'TABLE'" " UNION SELECT 'ONLY'");
warning: 1 line adds whitespace errors.
---
2. The command "LOCK TABLE a, b;" can be executed, but tab-completion doesn't work properly. Is it OK?
--
Regards,
--
Shinya Kato
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
2021-09-28 07:13 (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 07:36 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Fujii Masao <masao.fujii@oss.nttdata.com>
2021-09-28 08:03 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 08:06 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 13:55 ` RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Shinya11.Kato@nttdata.com
@ 2021-09-29 04:54 ` bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-30 03:18 ` RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Shinya11.Kato@nttdata.com
0 siblings, 1 reply; 12+ messages in thread
From: bt21tanigaway @ 2021-09-29 04:54 UTC (permalink / raw)
To: Shinya11.Kato@nttdata.com; +Cc: masao.fujii@oss.nttdata.com; pgsql-hackers@lists.postgresql.org
2021-09-28 22:55 に Shinya11.Kato@nttdata.com さんは書きました:
>> -----Original Message-----
>> From: bt21tanigaway <bt21tanigaway@oss.nttdata.com>
>> Sent: Tuesday, September 28, 2021 5:06 PM
>> To: Fujii Masao <masao.fujii@oss.nttdata.com>;
>> pgsql-hackers@lists.postgresql.org
>> Subject: Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet
>> implemented
>>
>> 2021-09-28 17:03 に bt21tanigaway さんは書きました:
>>> 2021-09-28 16:36 に Fujii Masao さんは書きました:
>>>> On 2021/09/28 16:13, bt21tanigaway wrote:
>>>>> Hi,
>>>>>
>>>>> (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented in
>>>>> tab-complete. I made a patch for these options.
>>>>
>>>> Thanks for the patch!
>>>> The patch seems to forget to handle the tab-completion for "LOCK
>>>> ONLY
>>>> <table-name> IN".
>>>
>>> Thanks for your comment!
>>> I attach a new patch fixed to this mail.
>>>
>>> Regards,
>>>
>>> Koyu Tanigawa
>>
>> Sorry, I forgot to attach patch file.
>> "fix-tab-complete2.patch" is fixed!
>>
>> Regards,
>>
>> Koyu Tanigawa
> Thank you for your patch.
> I have two comments.
>
> 1. When I executed git apply, an error occured.
> ---
> $ git apply ~/Downloads/fix-tab-complete2.patch
> /home/penguin/Downloads/fix-tab-complete2.patch:14: indent with spaces.
> COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, " UNION
> SELECT 'TABLE'" " UNION SELECT 'ONLY'");
> warning: 1 line adds whitespace errors.
> ---
>
Thank you for your feedback.
I might have added whitespace when I was checking the patch file.
I attach a new patch to this mail.
> 2. The command "LOCK TABLE a, b;" can be executed, but tab-completion
> doesn't work properly. Is it OK?
It's OK for now.
But it should be able to handle a case of multiple tables in the future.
Regards,
Koyu Tanigawa
Attachments:
diff5.patch (text/x-diff, 3.4K) download
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 5cd5838668..eada1f453c 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -3599,39 +3599,52 @@ psql_completion(const char *text, int start, int end)
COMPLETE_WITH("(");
/* LOCK */
- /* Complete LOCK [TABLE] with a list of tables */
+ /* Complete LOCK [TABLE] [ONLY] with a list of tables */
else if (Matches("LOCK"))
- COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,
- " UNION SELECT 'TABLE'");
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, " UNION SELECT 'TABLE'" " UNION SELECT 'ONLY'");
+
else if (Matches("LOCK", "TABLE"))
- COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, "");
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, " UNION SELECT 'ONLY'");
+ else if (Matches("LOCK", "TABLE", "ONLY") || Matches("LOCK", "ONLY"))
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, "");
/* For the following, handle the case of a single table only for now */
-
- /* Complete LOCK [TABLE] <table> with "IN" */
- else if (Matches("LOCK", MatchAnyExcept("TABLE")) ||
- Matches("LOCK", "TABLE", MatchAny))
- COMPLETE_WITH("IN");
-
- /* Complete LOCK [TABLE] <table> IN with a lock mode */
+
+ /* Complete LOCK [TABLE] [ONLY] <table> with "IN" or "NOWAIT" */
+ else if (Matches("LOCK", MatchAnyExcept("TABLE|ONLY")) ||
+ Matches("LOCK", "TABLE", MatchAnyExcept("ONLY")) ||
+ Matches("LOCK", "ONLY", MatchAny) ||
+ Matches("LOCK", "TABLE", "ONLY", MatchAny))
+ COMPLETE_WITH("IN", "NOWAIT");
+
+ /* Complete LOCK [TABLE] [ONLY] <table> IN with a lock mode */
else if (Matches("LOCK", MatchAny, "IN") ||
- Matches("LOCK", "TABLE", MatchAny, "IN"))
+ Matches("LOCK", "TABLE", MatchAny, "IN") ||
+ Matches("LOCK", "ONLY", MatchAny, "IN") ||
+ Matches("LOCK", "TABLE", "ONLY", MatchAny, "IN"))
COMPLETE_WITH("ACCESS SHARE MODE",
"ROW SHARE MODE", "ROW EXCLUSIVE MODE",
"SHARE UPDATE EXCLUSIVE MODE", "SHARE MODE",
"SHARE ROW EXCLUSIVE MODE",
"EXCLUSIVE MODE", "ACCESS EXCLUSIVE MODE");
- /* Complete LOCK [TABLE] <table> IN ACCESS|ROW with rest of lock mode */
+ /* Complete LOCK [TABLE][ONLY] <table> IN ACCESS|ROW with rest of lock mode */
else if (Matches("LOCK", MatchAny, "IN", "ACCESS|ROW") ||
- Matches("LOCK", "TABLE", MatchAny, "IN", "ACCESS|ROW"))
+ Matches("LOCK", "TABLE", MatchAny, "IN", "ACCESS|ROW") ||
+ Matches("LOCK", "ONLY", MatchAny, "IN", "ACCESS|ROW") ||
+ Matches("LOCK", "TABLE", "ONLY", MatchAny, "IN", "ACCESS|ROW"))
COMPLETE_WITH("EXCLUSIVE MODE", "SHARE MODE");
- /* Complete LOCK [TABLE] <table> IN SHARE with rest of lock mode */
+ /* Complete LOCK [TABLE] [ONLY] <table> IN SHARE with rest of lock mode */
else if (Matches("LOCK", MatchAny, "IN", "SHARE") ||
- Matches("LOCK", "TABLE", MatchAny, "IN", "SHARE"))
- COMPLETE_WITH("MODE", "ROW EXCLUSIVE MODE",
- "UPDATE EXCLUSIVE MODE");
+ Matches("LOCK", "TABLE", MatchAny, "IN", "SHARE") ||
+ Matches("LOCK", "ONLY", MatchAny, "IN", "SHARE") ||
+ Matches("LOCK", "TABLE", "ONLY", MatchAny, "IN", "SHARE"))
+ COMPLETE_WITH("MODE", "ROW EXCLUSIVE MODE", "UPDATE EXCLUSIVE MODE");
+
+ /* Complete LOCK [TABLE] [ONLY] <table> [IN lockmode MODE] with "NOWAIT"*/
+ else if (HeadMatches("LOCK") && TailMatches("MODE"))
+ COMPLETE_WITH("NOWAIT");
/* NOTIFY --- can be inside EXPLAIN, RULE, etc */
else if (TailMatches("NOTIFY"))
^ permalink raw reply [nested|flat] 12+ messages in thread
* RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
2021-09-28 07:13 (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 07:36 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Fujii Masao <masao.fujii@oss.nttdata.com>
2021-09-28 08:03 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 08:06 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 13:55 ` RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Shinya11.Kato@nttdata.com
2021-09-29 04:54 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
@ 2021-09-30 03:18 ` Shinya11.Kato@nttdata.com
2021-10-04 02:17 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
0 siblings, 1 reply; 12+ messages in thread
From: Shinya11.Kato@nttdata.com @ 2021-09-30 03:18 UTC (permalink / raw)
To: bt21tanigaway@oss.nttdata.com; +Cc: masao.fujii@oss.nttdata.com; pgsql-hackers@lists.postgresql.org
>Thank you for your feedback.
>I might have added whitespace when I was checking the patch file.
>I attach a new patch to this mail.
Thank you for the update!
> else if (Matches("LOCK", MatchAny, "IN", "ACCESS|ROW") ||
>- Matches("LOCK", "TABLE", MatchAny, "IN", "ACCESS|ROW"))
>+ Matches("LOCK", "TABLE", MatchAny, "IN", "ACCESS|ROW") ||
>+ Matches("LOCK", "ONLY", MatchAny, "IN", "ACCESS|ROW") ||
>+ Matches("LOCK", "TABLE", "ONLY", MatchAny, "IN", "ACCESS|ROW"))
I think this code is redundant, so I change following.
---
else if (HeadMatches("LOCK") && TailMatches("IN", "ACCESS|ROW"))
---
I created the patch, and attached it. Do you think?
>> 2. The command "LOCK TABLE a, b;" can be executed, but tab-completion
>> doesn't work properly. Is it OK?
>It's OK for now.
>But it should be able to handle a case of multiple tables in the future.
OK. I agreed.
Regards,
Shinya Kato
Attachments:
fix_tab_completion_of_lock.patch (application/octet-stream, 3.0K) download
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 5cd5838668..6e7721e57f 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -3599,39 +3599,43 @@ psql_completion(const char *text, int start, int end)
COMPLETE_WITH("(");
/* LOCK */
- /* Complete LOCK [TABLE] with a list of tables */
+ /* Complete LOCK [TABLE] [ONLY] with a list of tables */
else if (Matches("LOCK"))
- COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,
- " UNION SELECT 'TABLE'");
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, " UNION SELECT 'TABLE'" " UNION SELECT 'ONLY'");
+
else if (Matches("LOCK", "TABLE"))
- COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, "");
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, " UNION SELECT 'ONLY'");
+ else if (Matches("LOCK", "TABLE", "ONLY") || Matches("LOCK", "ONLY"))
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, "");
/* For the following, handle the case of a single table only for now */
- /* Complete LOCK [TABLE] <table> with "IN" */
- else if (Matches("LOCK", MatchAnyExcept("TABLE")) ||
- Matches("LOCK", "TABLE", MatchAny))
- COMPLETE_WITH("IN");
+ /* Complete LOCK [TABLE] [ONLY] <table> with "IN" or "NOWAIT" */
+ else if (Matches("LOCK", MatchAnyExcept("TABLE|ONLY")) ||
+ Matches("LOCK", "TABLE", MatchAnyExcept("ONLY")) ||
+ Matches("LOCK", "ONLY", MatchAny) ||
+ Matches("LOCK", "TABLE", "ONLY", MatchAny))
+ COMPLETE_WITH("IN", "NOWAIT");
- /* Complete LOCK [TABLE] <table> IN with a lock mode */
- else if (Matches("LOCK", MatchAny, "IN") ||
- Matches("LOCK", "TABLE", MatchAny, "IN"))
+ /* Complete LOCK [TABLE] [ONLY] <table> IN with a lock mode */
+ else if (HeadMatches("LOCK") && TailMatches("IN"))
COMPLETE_WITH("ACCESS SHARE MODE",
"ROW SHARE MODE", "ROW EXCLUSIVE MODE",
"SHARE UPDATE EXCLUSIVE MODE", "SHARE MODE",
"SHARE ROW EXCLUSIVE MODE",
"EXCLUSIVE MODE", "ACCESS EXCLUSIVE MODE");
- /* Complete LOCK [TABLE] <table> IN ACCESS|ROW with rest of lock mode */
- else if (Matches("LOCK", MatchAny, "IN", "ACCESS|ROW") ||
- Matches("LOCK", "TABLE", MatchAny, "IN", "ACCESS|ROW"))
+ /* Complete LOCK [TABLE][ONLY] <table> IN ACCESS|ROW with rest of lock mode */
+ else if (HeadMatches("LOCK") && TailMatches("IN", "ACCESS|ROW"))
COMPLETE_WITH("EXCLUSIVE MODE", "SHARE MODE");
- /* Complete LOCK [TABLE] <table> IN SHARE with rest of lock mode */
- else if (Matches("LOCK", MatchAny, "IN", "SHARE") ||
- Matches("LOCK", "TABLE", MatchAny, "IN", "SHARE"))
- COMPLETE_WITH("MODE", "ROW EXCLUSIVE MODE",
- "UPDATE EXCLUSIVE MODE");
+ /* Complete LOCK [TABLE] [ONLY] <table> IN SHARE with rest of lock mode */
+ else if (HeadMatches("LOCK") && TailMatches("IN", "SHARE"))
+ COMPLETE_WITH("MODE", "ROW EXCLUSIVE MODE", "UPDATE EXCLUSIVE MODE");
+
+ /* Complete LOCK [TABLE] [ONLY] <table> [IN lockmode MODE] with "NOWAIT"*/
+ else if (HeadMatches("LOCK") && TailMatches("MODE"))
+ COMPLETE_WITH("NOWAIT");
/* NOTIFY --- can be inside EXPLAIN, RULE, etc */
else if (TailMatches("NOTIFY"))
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
2021-09-28 07:13 (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 07:36 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Fujii Masao <masao.fujii@oss.nttdata.com>
2021-09-28 08:03 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 08:06 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 13:55 ` RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Shinya11.Kato@nttdata.com
2021-09-29 04:54 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-30 03:18 ` RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Shinya11.Kato@nttdata.com
@ 2021-10-04 02:17 ` bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-10-04 04:59 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Fujii Masao <masao.fujii@oss.nttdata.com>
0 siblings, 1 reply; 12+ messages in thread
From: bt21tanigaway @ 2021-10-04 02:17 UTC (permalink / raw)
To: Shinya11.Kato@nttdata.com; +Cc: masao.fujii@oss.nttdata.com; pgsql-hackers@lists.postgresql.org
>> else if (Matches("LOCK", MatchAny, "IN", "ACCESS|ROW") ||
>> - Matches("LOCK", "TABLE", MatchAny, "IN", "ACCESS|ROW"))
>> + Matches("LOCK", "TABLE", MatchAny, "IN", "ACCESS|ROW") ||
>> + Matches("LOCK", "ONLY", MatchAny, "IN", "ACCESS|ROW") ||
>> + Matches("LOCK", "TABLE", "ONLY", MatchAny, "IN", "ACCESS|ROW"))
> I think this code is redundant, so I change following.
> ---
> else if (HeadMatches("LOCK") && TailMatches("IN", "ACCESS|ROW"))
> ---
> I created the patch, and attached it. Do you think?
Thank you for update!
I think that your code is more concise than mine.
There seems to be no problem.
Regards,
Koyu Tanigawa
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
2021-09-28 07:13 (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 07:36 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Fujii Masao <masao.fujii@oss.nttdata.com>
2021-09-28 08:03 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 08:06 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 13:55 ` RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Shinya11.Kato@nttdata.com
2021-09-29 04:54 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-30 03:18 ` RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Shinya11.Kato@nttdata.com
2021-10-04 02:17 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
@ 2021-10-04 04:59 ` Fujii Masao <masao.fujii@oss.nttdata.com>
2021-10-04 05:28 ` RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Shinya11.Kato@nttdata.com
0 siblings, 1 reply; 12+ messages in thread
From: Fujii Masao @ 2021-10-04 04:59 UTC (permalink / raw)
To: bt21tanigaway <bt21tanigaway@oss.nttdata.com>; Shinya11.Kato@nttdata.com; +Cc: pgsql-hackers@lists.postgresql.org
On 2021/10/04 11:17, bt21tanigaway wrote:
>>> else if (Matches("LOCK", MatchAny, "IN", "ACCESS|ROW") ||
>>> - Matches("LOCK", "TABLE", MatchAny, "IN", "ACCESS|ROW"))
>>> + Matches("LOCK", "TABLE", MatchAny, "IN", "ACCESS|ROW") ||
>>> + Matches("LOCK", "ONLY", MatchAny, "IN", "ACCESS|ROW") ||
>>> + Matches("LOCK", "TABLE", "ONLY", MatchAny, "IN", "ACCESS|ROW"))
>> I think this code is redundant, so I change following.
>> ---
>> else if (HeadMatches("LOCK") && TailMatches("IN", "ACCESS|ROW"))
>> ---
>> I created the patch, and attached it. Do you think?
> Thank you for update!
> I think that your code is more concise than mine.
> There seems to be no problem.
The patch looks good to me, too. I applied cosmetic changes to it.
Attached is the updated version of the patch. Barring any objection,
I will commit it.
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
Attachments:
fix_tab_completion_of_lock_fujii.patch (text/plain, 3.1K) download
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 5cd5838668..ecae9df8ed 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -3599,40 +3599,49 @@ psql_completion(const char *text, int start, int end)
COMPLETE_WITH("(");
/* LOCK */
- /* Complete LOCK [TABLE] with a list of tables */
+ /* Complete LOCK [TABLE] [ONLY] with a list of tables */
else if (Matches("LOCK"))
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,
- " UNION SELECT 'TABLE'");
+ " UNION SELECT 'TABLE'"
+ " UNION SELECT 'ONLY'");
else if (Matches("LOCK", "TABLE"))
- COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, "");
-
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,
+ " UNION SELECT 'ONLY'");
+ else if (Matches("LOCK", "TABLE", "ONLY") || Matches("LOCK", "ONLY"))
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
/* For the following, handle the case of a single table only for now */
- /* Complete LOCK [TABLE] <table> with "IN" */
- else if (Matches("LOCK", MatchAnyExcept("TABLE")) ||
- Matches("LOCK", "TABLE", MatchAny))
- COMPLETE_WITH("IN");
+ /* Complete LOCK [TABLE] [ONLY] <table> with IN or NOWAIT */
+ else if (Matches("LOCK", MatchAnyExcept("TABLE|ONLY")) ||
+ Matches("LOCK", "TABLE", MatchAnyExcept("ONLY")) ||
+ Matches("LOCK", "ONLY", MatchAny) ||
+ Matches("LOCK", "TABLE", "ONLY", MatchAny))
+ COMPLETE_WITH("IN", "NOWAIT");
- /* Complete LOCK [TABLE] <table> IN with a lock mode */
- else if (Matches("LOCK", MatchAny, "IN") ||
- Matches("LOCK", "TABLE", MatchAny, "IN"))
+ /* Complete LOCK [TABLE] [ONLY] <table> IN with a lock mode */
+ else if (HeadMatches("LOCK") && TailMatches("IN"))
COMPLETE_WITH("ACCESS SHARE MODE",
"ROW SHARE MODE", "ROW EXCLUSIVE MODE",
"SHARE UPDATE EXCLUSIVE MODE", "SHARE MODE",
"SHARE ROW EXCLUSIVE MODE",
"EXCLUSIVE MODE", "ACCESS EXCLUSIVE MODE");
- /* Complete LOCK [TABLE] <table> IN ACCESS|ROW with rest of lock mode */
- else if (Matches("LOCK", MatchAny, "IN", "ACCESS|ROW") ||
- Matches("LOCK", "TABLE", MatchAny, "IN", "ACCESS|ROW"))
+ /*
+ * Complete LOCK [TABLE][ONLY] <table> IN ACCESS|ROW with rest of lock
+ * mode
+ */
+ else if (HeadMatches("LOCK") && TailMatches("IN", "ACCESS|ROW"))
COMPLETE_WITH("EXCLUSIVE MODE", "SHARE MODE");
- /* Complete LOCK [TABLE] <table> IN SHARE with rest of lock mode */
- else if (Matches("LOCK", MatchAny, "IN", "SHARE") ||
- Matches("LOCK", "TABLE", MatchAny, "IN", "SHARE"))
+ /* Complete LOCK [TABLE] [ONLY] <table> IN SHARE with rest of lock mode */
+ else if (HeadMatches("LOCK") && TailMatches("IN", "SHARE"))
COMPLETE_WITH("MODE", "ROW EXCLUSIVE MODE",
"UPDATE EXCLUSIVE MODE");
+ /* Complete LOCK [TABLE] [ONLY] <table> [IN lockmode MODE] with "NOWAIT" */
+ else if (HeadMatches("LOCK") && TailMatches("MODE"))
+ COMPLETE_WITH("NOWAIT");
+
/* NOTIFY --- can be inside EXPLAIN, RULE, etc */
else if (TailMatches("NOTIFY"))
COMPLETE_WITH_QUERY("SELECT pg_catalog.quote_ident(channel) FROM pg_catalog.pg_listening_channels() AS channel WHERE substring(pg_catalog.quote_ident(channel),1,%d)='%s'");
^ permalink raw reply [nested|flat] 12+ messages in thread
* RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
2021-09-28 07:13 (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 07:36 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Fujii Masao <masao.fujii@oss.nttdata.com>
2021-09-28 08:03 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 08:06 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 13:55 ` RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Shinya11.Kato@nttdata.com
2021-09-29 04:54 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-30 03:18 ` RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Shinya11.Kato@nttdata.com
2021-10-04 02:17 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-10-04 04:59 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Fujii Masao <masao.fujii@oss.nttdata.com>
@ 2021-10-04 05:28 ` Shinya11.Kato@nttdata.com
2021-10-05 01:15 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Fujii Masao <masao.fujii@oss.nttdata.com>
0 siblings, 1 reply; 12+ messages in thread
From: Shinya11.Kato@nttdata.com @ 2021-10-04 05:28 UTC (permalink / raw)
To: masao.fujii@oss.nttdata.com; bt21tanigaway@oss.nttdata.com; +Cc: pgsql-hackers@lists.postgresql.org
>-----Original Message-----
>From: Fujii Masao <masao.fujii@oss.nttdata.com>
>Sent: Monday, October 4, 2021 1:59 PM
>To: bt21tanigaway <bt21tanigaway@oss.nttdata.com>; RDH 加藤 慎也/Kato,
>Shinya (NTT DATA) <Shinya11.Kato@jp.nttdata.com>
>Cc: pgsql-hackers@lists.postgresql.org
>Subject: Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet
>implemented
>
>
>
>On 2021/10/04 11:17, bt21tanigaway wrote:
>>>> else if (Matches("LOCK", MatchAny, "IN", "ACCESS|ROW") ||
>>>> - Matches("LOCK", "TABLE", MatchAny, "IN",
>>>> "ACCESS|ROW"))
>>>> + Matches("LOCK", "TABLE", MatchAny, "IN",
>"ACCESS|ROW")
>>>> +||
>>>> + Matches("LOCK", "ONLY", MatchAny, "IN",
>"ACCESS|ROW")
>>>> +||
>>>> + Matches("LOCK", "TABLE", "ONLY", MatchAny, "IN",
>>>> +"ACCESS|ROW"))
>>> I think this code is redundant, so I change following.
>>> ---
>>> else if (HeadMatches("LOCK") && TailMatches("IN", "ACCESS|ROW"))
>>> ---
>>> I created the patch, and attached it. Do you think?
>> Thank you for update!
>> I think that your code is more concise than mine.
>> There seems to be no problem.
>
>The patch looks good to me, too. I applied cosmetic changes to it.
>Attached is the updated version of the patch. Barring any objection, I will commit
>it.
Thank you for the patch!
It looks good to me.
Regards,
Shinya Kato
^ permalink raw reply [nested|flat] 12+ messages in thread
* Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
2021-09-28 07:13 (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 07:36 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Fujii Masao <masao.fujii@oss.nttdata.com>
2021-09-28 08:03 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 08:06 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 13:55 ` RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Shinya11.Kato@nttdata.com
2021-09-29 04:54 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-30 03:18 ` RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Shinya11.Kato@nttdata.com
2021-10-04 02:17 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-10-04 04:59 ` Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Fujii Masao <masao.fujii@oss.nttdata.com>
2021-10-04 05:28 ` RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented Shinya11.Kato@nttdata.com
@ 2021-10-05 01:15 ` Fujii Masao <masao.fujii@oss.nttdata.com>
0 siblings, 0 replies; 12+ messages in thread
From: Fujii Masao @ 2021-10-05 01:15 UTC (permalink / raw)
To: Shinya11.Kato@nttdata.com; bt21tanigaway@oss.nttdata.com; +Cc: pgsql-hackers@lists.postgresql.org
On 2021/10/04 14:28, Shinya11.Kato@nttdata.com wrote:
>> The patch looks good to me, too. I applied cosmetic changes to it.
>> Attached is the updated version of the patch. Barring any objection, I will commit
>> it.
> Thank you for the patch!
> It looks good to me.
Pushed. Thanks!
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
^ permalink raw reply [nested|flat] 12+ messages in thread
end of thread, other threads:[~2021-10-05 01:15 UTC | newest]
Thread overview: 12+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-09-28 07:13 (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 07:36 ` Fujii Masao <masao.fujii@oss.nttdata.com>
2021-09-28 08:03 ` bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 08:06 ` bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-28 13:46 ` Shinya Kato <katousnk@oss.nttdata.com>
2021-09-28 13:55 ` Shinya11.Kato@nttdata.com
2021-09-29 04:54 ` bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-09-30 03:18 ` Shinya11.Kato@nttdata.com
2021-10-04 02:17 ` bt21tanigaway <bt21tanigaway@oss.nttdata.com>
2021-10-04 04:59 ` Fujii Masao <masao.fujii@oss.nttdata.com>
2021-10-04 05:28 ` Shinya11.Kato@nttdata.com
2021-10-05 01:15 ` Fujii Masao <masao.fujii@oss.nttdata.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox