Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHo8K-0003KA-Fu for pgsql-general@arkaria.postgresql.org; Tue, 17 Jan 2023 15:44:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pHo8J-00005p-Bx for pgsql-general@arkaria.postgresql.org; Tue, 17 Jan 2023 15:44:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHo8H-00005d-Pz for pgsql-general@lists.postgresql.org; Tue, 17 Jan 2023 15:44:19 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHo8E-0004gB-MH for pgsql-general@lists.postgresql.org; Tue, 17 Jan 2023 15:44:16 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id A48D732003CE; Tue, 17 Jan 2023 10:44:11 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 17 Jan 2023 10:44:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1673970251; x= 1674056651; bh=pwgOok6YCrom73BYQZIr7egxFOUYvpn8+0f5S1wnOy0=; b=p cEFUk3OZpVIQU+2xQ+DzvJrzWHLiOHM7S4Z2YLVdH/Xk72HIDsl657WZCHlKqlAK jcIsBzP0gdiIftDX/euUWm9Oa99MNvBLMo35VLJ+JZXXRLcYTZvirv9UkoKzidqh eLQP+GPKN3pYesSaKCqfs90ZbwFQkUzn/Us1jmLAUYPp4/+SrR32+MI4JIiP3q5w n586kmtrdv4wQK1+X6OCK/l3kK0SYMPH0098ytwqAAJOKa2pIsy82cy4fP1Zu90H HpRloDg8P1VPWywbAgz1lwYGzmAKknw+cs8ubYvKK6jpjBMd2+AzHeYyLAXb5cSA 7DJcS1Op4R/G7iC4/BjOw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1673970251; x= 1674056651; bh=pwgOok6YCrom73BYQZIr7egxFOUYvpn8+0f5S1wnOy0=; b=d cpwaOyIfMVub+fFqZlOFFMoYUO6/KOUt+mXaPAf4VH4zj6kNBPqDYSJ9P3HiUin/ MlI1sREUEJMe7fYWzg4MUggowzo25xQetdNFDp8NiMFbn0iT8EOSNz8n8AzOUcHU /H471t93EImWtCR5ogGbHMnhh0YjmOX38pTTGf/W9Lv2UzFPbEPdCCpyRbLqmRmm mNcHotQDjcNdhu8sBhdHMSDoyI8rejuCzos73eGv4gtBMYs7hCvZukfZ5iSSYQlb +GcQRoW3f1KsyHjAyg6kU2gLd9bje8ONngdmCPnRgZSvnHdehUFEL8H0FbRls67o jf/LLoJX4VZgA4SDqW+Sg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddtiedgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnheptdettefhgfdvhfdtfeeutdegvefhudffiefgvdfh veffgefhudfgleelffelfedunecuffhomhgrihhnpegthigsvghrthgvtgdqphhoshhtgh hrvghsqhhlrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 17 Jan 2023 10:44:10 -0500 (EST) Message-ID: <3942b14b-be82-805f-3ec4-3be85d89b2b6@aklaver.com> Date: Tue, 17 Jan 2023 07:44:09 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: Tablespace OID, database OID, relfilenode To: Wiwwo Staff , Laurenz Albe Cc: pgsql-general@lists.postgresql.org References: <1505292e2bedcfcf13e9334f686946742b9db7f2.camel@cybertec.at> Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 1/17/23 07:35, Wiwwo Staff wrote: > Hi Laurenz, > thanks for your answer! > Ok, but I don't think "1663" is a sort of constant value for "base", > isn't it? From source: backend/catalog/postgres.bki open pg_tablespace insert ( 1663 pg_default 10 _null_ _null_ ) insert ( 1664 pg_global 10 _null_ _null_ ) > > Let me clarify my question: how do I get, with a query, from "base" to > 1663 (or whatever the value is)? select * from pg_tablespace ; oid | spcname | spcowner | spcacl | spcoptions ------+------------+----------+--------+------------ 1663 | pg_default | 10 | NULL | NULL 1664 | pg_global | 10 | NULL | NULL > > On Tue, Jan 17, 2023 at 4:01 PM Laurenz Albe > wrote: > > On Tue, 2023-01-17 at 15:48 +0100, Wiwwo Staff wrote: > > Quick and to the point: > > > > If i execute > > select pg_relation_filepath('pgbench_accounts'); > > > > I get > >  pg_relation_filepath > > ---------------------- > >  base/5/16398 > > > > where "base" is tablespace, but not tablespace OID, nor > tablespace name. > > How do I link it to get from "base" the tablespace OID? > > > > Or, in other words, given table  pgbench_accounts, how do I get > tablespace OID, > > database OID and relfilenode so that I can use this info to > filter output of pg_waldump? > > The tablespace OID is 1663, since "base" is the default tablespace > "pg_default". > > Yours, > Laurenz Albe > -- > Cybertec | https://www.cybertec-postgresql.com > > -- Adrian Klaver adrian.klaver@aklaver.com