(LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented

Lists: pgsql-hackers
From: bt21tanigaway <bt21tanigaway(at)oss(dot)nttdata(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
Date: 2021-09-28 07:13:45
Message-ID: a322684daa36319e6ebc60b541000a3a@oss.nttdata.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

(LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented in
tab-complete. I made a patch for these options.

regards,
Koyu Tanigawa

Attachment Content-Type Size
fix-tab-complete.patch text/x-diff 3.2 KB

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: bt21tanigaway <bt21tanigaway(at)oss(dot)nttdata(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
Date: 2021-09-28 07:36:49
Message-ID: 79967bce-cc80-1941-463b-883bd5606790@oss.nttdata.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

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


From: bt21tanigaway <bt21tanigaway(at)oss(dot)nttdata(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
Date: 2021-09-28 08:03:57
Message-ID: 81b150bf40a3dad24fb8674feb07308e@oss.nttdata.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

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


From: bt21tanigaway <bt21tanigaway(at)oss(dot)nttdata(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
Date: 2021-09-28 08:06:29
Message-ID: bf29c936d1ba16d71423bde2ce2d4be1@oss.nttdata.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

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

Attachment Content-Type Size
fix-tab-complete2.patch text/x-diff 3.4 KB

From: Shinya Kato <katousnk(at)oss(dot)nttdata(dot)com>
To: bt21tanigaway <bt21tanigaway(at)oss(dot)nttdata(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Shinya11(dot)Kato(at)nttdata(dot)com
Subject: Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
Date: 2021-09-28 13:46:35
Message-ID: c9cb8e6b4ff37e1bd7e4746964eef05b@oss.nttdata.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

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


From: <Shinya11(dot)Kato(at)nttdata(dot)com>
To: <bt21tanigaway(at)oss(dot)nttdata(dot)com>, <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
Date: 2021-09-28 13:55:48
Message-ID: TYAPR01MB28966A3AAE20D0A48C9BF41BC4A89@TYAPR01MB2896.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

>-----Original Message-----
>From: bt21tanigaway <bt21tanigaway(at)oss(dot)nttdata(dot)com>
>Sent: Tuesday, September 28, 2021 5:06 PM
>To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>;
>pgsql-hackers(at)lists(dot)postgresql(dot)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


From: bt21tanigaway <bt21tanigaway(at)oss(dot)nttdata(dot)com>
To: Shinya11(dot)Kato(at)nttdata(dot)com
Cc: masao(dot)fujii(at)oss(dot)nttdata(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
Date: 2021-09-29 04:54:58
Message-ID: 913e1abb8fca30aeb370343d47876a0c@oss.nttdata.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

2021-09-28 22:55 に Shinya11(dot)Kato(at)nttdata(dot)com さんは書きました:
>> -----Original Message-----
>> From: bt21tanigaway <bt21tanigaway(at)oss(dot)nttdata(dot)com>
>> Sent: Tuesday, September 28, 2021 5:06 PM
>> To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>;
>> pgsql-hackers(at)lists(dot)postgresql(dot)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

Attachment Content-Type Size
diff5.patch text/x-diff 3.4 KB

From: <Shinya11(dot)Kato(at)nttdata(dot)com>
To: <bt21tanigaway(at)oss(dot)nttdata(dot)com>
Cc: <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
Date: 2021-09-30 03:18:29
Message-ID: TYAPR01MB2896005A7BA10FEDD897B4E3C4AA9@TYAPR01MB2896.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

>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

Attachment Content-Type Size
fix_tab_completion_of_lock.patch application/octet-stream 3.0 KB

From: bt21tanigaway <bt21tanigaway(at)oss(dot)nttdata(dot)com>
To: Shinya11(dot)Kato(at)nttdata(dot)com
Cc: masao(dot)fujii(at)oss(dot)nttdata(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
Date: 2021-10-04 02:17:19
Message-ID: d4e33e4f465d67c6e723a7f45eeb1d43@oss.nttdata.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

>> 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


From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: bt21tanigaway <bt21tanigaway(at)oss(dot)nttdata(dot)com>, Shinya11(dot)Kato(at)nttdata(dot)com
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
Date: 2021-10-04 04:59:19
Message-ID: 0d484953-8bfc-9e88-2dfd-3cb1cb4a3e59@oss.nttdata.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

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

Attachment Content-Type Size
fix_tab_completion_of_lock_fujii.patch text/plain 3.1 KB

From: <Shinya11(dot)Kato(at)nttdata(dot)com>
To: <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, <bt21tanigaway(at)oss(dot)nttdata(dot)com>
Cc: <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
Date: 2021-10-04 05:28:15
Message-ID: TYAPR01MB2896C8DF324DA02EF1857491C4AE9@TYAPR01MB2896.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

>-----Original Message-----
>From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
>Sent: Monday, October 4, 2021 1:59 PM
>To: bt21tanigaway <bt21tanigaway(at)oss(dot)nttdata(dot)com>; RDH 加藤 慎也/Kato,
>Shinya (NTT DATA) <Shinya11(dot)Kato(at)jp(dot)nttdata(dot)com>
>Cc: pgsql-hackers(at)lists(dot)postgresql(dot)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


From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Shinya11(dot)Kato(at)nttdata(dot)com, bt21tanigaway(at)oss(dot)nttdata(dot)com
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: (LOCK TABLE options) “ONLY” and “NOWAIT” are not yet implemented
Date: 2021-10-05 01:15:31
Message-ID: a34b4b4e-2359-44f3-bad6-3469ee509536@oss.nttdata.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On 2021/10/04 14:28, Shinya11(dot)Kato(at)nttdata(dot)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