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 1s2SIy-0039FF-8Y for pgsql-hackers@arkaria.postgresql.org; Thu, 02 May 2024 09:00:40 +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 1s2SIu-00GoMp-OY for pgsql-hackers@arkaria.postgresql.org; Thu, 02 May 2024 09:00:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s2SIu-00GoMg-F1 for pgsql-hackers@lists.postgresql.org; Thu, 02 May 2024 09:00:37 +0000 Received: from ml.sraoss.co.jp ([66.11.59.17]) by magus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s2SIq-00196p-DT for pgsql-hackers@postgresql.org; Thu, 02 May 2024 09:00:36 +0000 Received: from sranhm.sraoss.co.jp (unknown [192.168.174.164]) by osspc26.sraoss.co.jp (Postfix) with ESMTP id 286992F00096; Thu, 2 May 2024 18:00:28 +0900 (JST) Received: from yugon-CFSV7-1 (unknown [192.168.176.17]) by sranhm.sraoss.co.jp (Postfix) with SMTP id 0BECC341788; Thu, 2 May 2024 18:00:28 +0900 (JST) Date: Thu, 2 May 2024 18:00:27 +0900 From: Yugo NAGATA To: Matthias van de Meent Cc: Nathan Bossart , Tom Lane , pgsql-hackers@postgresql.org Subject: Re: Extend ALTER DEFAULT PRIVILEGES for large objects Message-Id: <20240502180027.45efab5dce240c8eb01411b8@sraoss.co.jp> In-Reply-To: References: <20240424115242.236b499b2bed5b7a27f7a418@sraoss.co.jp> <3602391.1713930458@sss.pgh.pa.us> <20240424210839.GA863220@nathanxps13> <20240426175406.13e47ea3904de814afbfe496@sraoss.co.jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 26 Apr 2024 12:23:45 +0200 Matthias van de Meent wrote: > On Fri, 26 Apr 2024 at 10:54, Yugo NAGATA wrote: > > > > On Wed, 24 Apr 2024 16:08:39 -0500 > > Nathan Bossart wrote: > > > > > On Tue, Apr 23, 2024 at 11:47:38PM -0400, Tom Lane wrote: > > > > On the whole I find this proposed feature pretty unexciting > > > > and dubiously worthy of the implementation/maintenance effort. > > > > > > I don't have any particularly strong feelings on $SUBJECT, but I'll admit > > > I'd be much more interested in resolving any remaining reasons folks are > > > using large objects over TOAST. I see a couple of reasons listed in the > > > docs [0] that might be worth examining. > > > > > > [0] https://www.postgresql.org/docs/devel/lo-intro.html > > > > If we could replace large objects with BYTEA in any use cases, large objects > > would be completely obsolete. However, currently some users use large objects > > in fact, so improvement in this feature seems beneficial for them. > > > > > > Apart from that, extending TOAST to support more than 1GB data and > > stream-style access seems a good challenge. I don't know if there was a > > proposal for this in past. This is just a thought, for this purpose, we > > will need a new type of varlena that can contains large size information, > > and a new toast table schema that can store offset information or some way > > to convert a offset to chunk_seq. > > If you're interested in this, you may want to check out [0] and [1] as > threads on the topic of improving TOAST handling of large values ([1] > being a thread where the limitations of our current external TOAST > pointer became clear once more), and maybe talk with Aleksander > Alekseev and Nikita Malakhov. They've been working closely with > systems that involve toast pointers and their limitations. > > The most recent update on the work of Nikita (reworking TOAST > handling) [2] is that he got started adapting their externally > pluggable toast into type-internal methods only, though I've not yet > noticed any updated patches appear on the list. Thank you for your information. I'll check the threads you mentioned. > As for other issues with creating larger TOAST values: > TOAST has a value limit of ~1GB, which means a single large value (or > two, for that matter) won't break anything in the wire protocol, as > DataRow messages have a message size field of uint32 [^3]. However, if > we're going to allow even larger values to be stored in table's > attributes, we'll have to figure out how we're going to transfer those > larger values to (and from) clients. For large objects, this is much > less of an issue because the IO operations are already chunked by > design, but this may not work well for types that you want to use in > your table's columns. I overlooked this issue. I faced the similar issue when I tried to pg_dump large text values, although the error was raised from enlargeStringInfo() in that case.... Regards, Yugo Nagata > Kind regards, > > Matthias van de Meent > > [0] https://postgr.es/m/flat/CAN-LCVMq2X%3Dfhx7KLxfeDyb3P%2BBXuCkHC0g%3D9GF%2BJD4izfVa0Q%40mail.gmail.com > [1] https://postgr.es/m/flat/CAJ7c6TOtAB0z1UrksvGTStNE-herK-43bj22%3D5xVBg7S4vr5rQ%40mail.gmail.com > [2] https://postgr.es/m/CAN-LCVOgMrda9hOdzGkCMdwY6dH0JQa13QvPsqUwY57TEn6jww%40mail.gmail.com > > [^3] Most, if not all PostgreSQL wire protocol messages have this > uint32 message size field, but the DataRow one is relevant here as > it's the one way users get their data out of the database. -- Yugo NAGATA