Re: Read data from Postgres table pages

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Sushrut Shivaswamy <sushrut(dot)shivaswamy(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Read data from Postgres table pages
Date: 2024-03-19 14:42:30
Message-ID: CAPpHfdstG2Eu6XwfwWLQUcTu+2vLxSJ_u9v0WWyJHzs57BOi2Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 19, 2024 at 4:35 PM Sushrut Shivaswamy
<sushrut(dot)shivaswamy(at)gmail(dot)com> wrote:
> The binary I"m trying to create should automatically be able to read data from a postgres instance without users having to
> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Koval 2024-03-19 14:43:33 Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Previous Message Joe Conway 2024-03-19 14:39:25 Re: Possibility to disable `ALTER SYSTEM`