From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Wiwwo Staff <wiwwo@wiwwo.com>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Tablespace OID, database OID, relfilenode
Date: Tue, 17 Jan 2023 07:44:09 -0800
Message-ID: <3942b14b-be82-805f-3ec4-3be85d89b2b6@aklaver.com> (raw)
In-Reply-To: <CAFe70G7qMpmasfNq4G3PgdEPubMkBJr34CZEPCPJ6eVF_sCtKg@mail.gmail.com>
References: <CAFe70G57o3OnGhDLLU6LG=eg8r5CapK9UmCcT93kvOi+7LFrGA@mail.gmail.com>
<1505292e2bedcfcf13e9334f686946742b9db7f2.camel@cybertec.at>
<CAFe70G7qMpmasfNq4G3PgdEPubMkBJr34CZEPCPJ6eVF_sCtKg@mail.gmail.com>
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 <laurenz.albe@cybertec.at
> <mailto:laurenz.albe@cybertec.at>> 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
> <https://www.cybertec-postgresql.com;
>
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, wiwwo@wiwwo.com, laurenz.albe@cybertec.at
Subject: Re: Tablespace OID, database OID, relfilenode
In-Reply-To: <3942b14b-be82-805f-3ec4-3be85d89b2b6@aklaver.com>
References: <CAFe70G57o3OnGhDLLU6LG=eg8r5CapK9UmCcT93kvOi+7LFrGA@mail.gmail.com> <1505292e2bedcfcf13e9334f686946742b9db7f2.camel@cybertec.at> <CAFe70G7qMpmasfNq4G3PgdEPubMkBJr34CZEPCPJ6eVF_sCtKg@mail.gmail.com> <3942b14b-be82-805f-3ec4-3be85d89b2b6@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox