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 1s1t9A-00FjAj-QB for pgsql-general@arkaria.postgresql.org; Tue, 30 Apr 2024 19:28:12 +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 1s1t97-008DQ8-9y for pgsql-general@arkaria.postgresql.org; Tue, 30 Apr 2024 19:28:10 +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 1s1t96-008DPz-VZ for pgsql-general@lists.postgresql.org; Tue, 30 Apr 2024 19:28:09 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s1t95-000or3-Bw for pgsql-general@lists.postgresql.org; Tue, 30 Apr 2024 19:28:08 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 43UJS5vb1800618; Tue, 30 Apr 2024 15:28:05 -0400 From: Tom Lane To: "David G. Johnston" cc: Gaurav Pant , pgsql-general@lists.postgresql.org Subject: Re: Introduction of a new field in pg_class indicating presence of a large object in a table In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Tue, 30 Apr 2024 12:13:52 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1800616.1714505285.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 30 Apr 2024 15:28:05 -0400 Message-ID: <1800617.1714505285@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Tue, Apr 30, 2024 at 11:57 AM Gaurav Pant > wrote: >> I wanted to know if there is any such system table that we can use to >> identify and map the fields containing large objects and the respective >> tables and if it is not already there, do we have any plans to incorporate >> the same in pg_class like we have for pg_toast? > Large Objects are nothing like TOAST. There is no system level association > between large objects and tables. Sure, the DBA can choose to store a > large object OID in a table, but how you'd go about figuring out which > columns contain those is going to be installation specific. Yeah. You might want to look at contrib/vacuumlo, but realize that that's fairly heuristic. > Though > hopefully they used a bigint data type and maybe added "oid" to the column > name...I suppose it would be interesting if one could define a FK on a > table and point it at pg_largeobject_metadata but that I suspect would be > the extent to which we'd do something along the lines of your request. That would solve the opposite problem, of preventing a column from containing any OIDs that *weren't* large object OIDs. Given that recording a large object OID elsewhere in the database is purely an application decision, I don't think there's a reasonable way for the system to track it. regards, tom lane