Re: Read data from Postgres table pages - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: Read data from Postgres table pages
Date
Msg-id CAPpHfdstG2Eu6XwfwWLQUcTu+2vLxSJ_u9v0WWyJHzs57BOi2Q@mail.gmail.com
Whole thread Raw
In response to Re: Read data from Postgres table pages  (Sushrut Shivaswamy <sushrut.shivaswamy@gmail.com>)
Responses Re: Read data from Postgres table pages
List pgsql-hackers
On Tue, Mar 19, 2024 at 4:35 PM Sushrut Shivaswamy
<sushrut.shivaswamy@gmail.com> wrote:
> The binary I"m trying to create should automatically be able to read data from a postgres instance without users
havingto 
> run commands for backup / pg_dump etc.
> Having access to the appropriate source headers would allow me to read the data.

Please, avoid the top-posting.
https://en.wikipedia.org/wiki/Posting_style#Top-posting

If you're looking to have a separate binary, why can't your binary
just *connect* to the postgres database and query the data?  This is
what pg_dump does, you can just do the same directly.  pg_dump doesn't
access the raw data.

Trying to read raw postgres data from the separate binary looks flat
wrong for your purposes.  First, you would have to replicate pretty
much postgres internals inside. Second, you can read the consistent
data only when postgres is stopped or didn't do any modifications
since the last checkpoint.

------
Regards,
Alexander Korotkov



pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: Possibility to disable `ALTER SYSTEM`
Next
From: Dmitry Koval
Date:
Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands