Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uPD9K-002ZL9-F0 for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Jun 2025 04:33:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uPD9H-00FCND-9F for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Jun 2025 04:33:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uPD9G-00FCN5-W0 for pgsql-hackers@lists.postgresql.org; Wed, 11 Jun 2025 04:33:15 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uPD9E-001N2d-0j for pgsql-hackers@postgresql.org; Wed, 11 Jun 2025 04:33:13 +0000 Received: from [192.168.11.2] (p1696134-ipoe.ipoe.ocn.ne.jp [118.0.93.133]) by oss.nttdata.com (Postfix) with ESMTPSA id E758D6093E; Wed, 11 Jun 2025 13:33:07 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com Message-ID: Date: Wed, 11 Jun 2025 13:33:07 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Extend ALTER DEFAULT PRIVILEGES for large objects Content-Language: en-US To: Yugo Nagata Cc: Laurenz Albe , Nathan Bossart , Tom Lane , pgsql-hackers@postgresql.org References: <20240424115242.236b499b2bed5b7a27f7a418@sraoss.co.jp> <3602391.1713930458@sss.pgh.pa.us> <20240424210839.GA863220@nathanxps13> <20240426175406.13e47ea3904de814afbfe496@sraoss.co.jp> <20240913161801.b1e60534d77fa9df447b775f@sraoss.co.jp> <9c0c4d7881d2450baf70edb0ae95415a81ac8cb1.camel@cybertec.at> <20250123192220.9bad2b9aec110bf335521276@sraoss.co.jp> <20250403230418.f41b23d155f6c6cb3cebcd92@sraoss.co.jp> <20250408122857.b2b06dde4e6a08290af02336@sraoss.co.jp> <20250611114937.b067c542192f8e5e740a2a4a@sraoss.co.jp> From: Fujii Masao In-Reply-To: <20250611114937.b067c542192f8e5e740a2a4a@sraoss.co.jp> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025/06/11 11:49, Yugo Nagata wrote: > While looking at the thread [1], I've remembered this thread. > The patches in this thread are partially v18-related, but include > enhancement or fixes for existing feature, so should they be postponed > to v19, or should be separated properly to v18 part and other? > > [1] https://www.postgresql.org/message-id/70372bdd-4399-4d5b-ab4f-6d4487a4911a%40oss.nttdata.com I see these patches more as enhancements to psql tab-completion, rather than fixes for clear oversights in the original commit. For example, if tab-completion for ALTER DEFAULT PRIVILEGES had completely missed LARGE OBJECTS, that would be an obvious oversight. But these patches go beyond that kind of issue. That said, if others think it's appropriate to include them in v18 for consistency or completeness, I'm fine with that. Regarding the 0002 patch: - else if (Matches("GRANT", MatchAnyN, "ON", MatchAny, MatchAny)) - COMPLETE_WITH("TO"); - else if (Matches("REVOKE", MatchAnyN, "ON", MatchAny, MatchAny)) - COMPLETE_WITH("FROM"); + else if (Matches("GRANT/REVOKE", MatchAnyN, "ON", MatchAny, MatchAny)) + { + if (TailMatches("FOREIGN", "SERVER")) + COMPLETE_WITH_QUERY(Query_for_list_of_servers); + else if (!TailMatches("LARGE", "OBJECT")) + { + if (Matches("GRANT", MatchAnyN, "ON", MatchAny, MatchAny)) + COMPLETE_WITH("TO"); + else + COMPLETE_WITH("FROM"); + } + } Wouldn't this change break the case where "GRANT ... ON TABLE ... " is supposed to complete with "TO"? Regards, -- Fujii Masao NTT DATA Japan Corporation