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.96) (envelope-from ) id 1vOLj2-003qHI-1P for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Nov 2025 20:02:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vOLj0-001KiW-2W for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Nov 2025 20:02:51 +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.96) (envelope-from ) id 1vOLj0-001KiO-11 for pgsql-hackers@lists.postgresql.org; Wed, 26 Nov 2025 20:02:50 +0000 Received: from mail1.dalibo.net ([51.159.93.128] helo=mail.dalibo.com) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1vOLix-001ctT-35 for pgsql-hackers@lists.postgresql.org; Wed, 26 Nov 2025 20:02:49 +0000 Received: from [192.168.10.227] (lputeaux-656-1-16-204.w82-127.abo.wanadoo.fr [82.127.147.204]) by mail.dalibo.com (Postfix) with ESMTPSA id 6B8B726994 for ; Wed, 26 Nov 2025 21:02:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dalibo.com; s=a; t=1764187366; bh=3kwbFGO/eEdH30dmRfR3Tephoq1gVH3jFZaUkntb+h8=; h=Date:Subject:To:References:From:In-Reply-To:From; b=XP2OZ+4EdBl06uj4AMXReIhAPRhZCUE30IOndxhqbTB1crcqmwZJVlkjDD5FwE2ha EstpD2dah/Ojgbbz97Jh+bcLMNNKh3Vol85hhe1ZS73G+lLzyCeKZDgN12U+4RW/8w OYKtR+Wi2grMSAkkpXgkQKmoEuB+YyNCt1U3lexA= Message-ID: Date: Wed, 26 Nov 2025 21:02:45 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: oid2name : add objects file path To: pgsql-hackers@lists.postgresql.org References: <907f85f4-ca62-438e-9dcc-33d551d29969@app.fastmail.com> Content-Language: fr From: Guillaume Lelarge Organization: Dalibo In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi David, I just looked at the commit fest entry and the bot says your patch needs=20 a rebase. Can you do it? Thanks. Regards. On 08/10/2025 14:44, David Bidoc wrote: > On Tue, Oct 7, 2025 at 11:47=E2=80=AFAM Euler Taveira wrote: >=20 >> 1. The database query is wrong because it is considering that all data= bases are >> in the default tablespace. If you create a database in a different tab= lespace >> you will notice the mistake. >=20 > Thank you for your feedback. >=20 > Indeed, the path is wrong if the default tablespace is not used. > I did not find a simple way to retrieve the database path (to my > knowledge there is > no function like pg_database_location() or something similar), so I hav= e removed > this part from the patch for now. >=20 >> >> 2. I suggest that you change one of the examples (maybe the last one) = to >> illustrate this feature. >=20 > Here is a new example by adding a table in a different tablespace : >=20 > $ oid2name -p 5435 -d b1 -t t2 -x > From database "b1": > Filenode Table Name Oid Schema Tablespace > Filepath > -----------------------------------------------------------------------= ----------------------- > 16403 t2 16403 public tblspc1 > pg_tblspc/16393/PG_19_202510082/16384/16403 >=20 >=20 >> Since you are in this area, you could create a separate patch for show= the >> tablespace location (-s option). Use pg_tablespace_location function. >> > I attached a new patch to add a column Tablespace Location to the -s op= tion. >=20 > $ oid2name -p 5435 -s > All tablespaces: > Oid Tablespace Name Tablespace Location > --------------------------------------------- > 1663 pg_default > 1664 pg_global > 16393 tblspc1 /mnt/tblspc1/pg >=20 >> Register your patch for the next commitfest so we don't lose track of = it. [1] >> If you don't have an account, the 'Log In' link will redirect you to t= he page >> to create a new one or even allow you to use a third party sign in. >> >> [1] https://commitfest.postgresql.org/56/ >> >=20 > Done. > https://commitfest.postgresql.org/patch/6111/ >=20 > Regards > David Bidoc --=20 Guillaume Lelarge Consultant https://dalibo.com