Re: Add contrib/pg_logicalsnapinspect
Peter Smith <smithpb2250@gmail.com>
From: Peter Smith <smithpb2250@gmail.com>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>,
Peter Eisentraut <peter@eisentraut.org>, shveta malik <shveta.malik@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>,
pgsql-hackers@lists.postgresql.org
Date: 2024-10-09T00:41:44Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix indentation issue
- b955df443405 18.0 cited
-
pg_logicalinspect: Stabilize isolation tests.
- a49927f04cd0 18.0 landed
-
Add contrib/pg_logicalinspect.
- 7cdfeee320e7 18.0 landed
-
Move SnapBuild and SnapBuildOnDisk structs to snapshot_internal.h.
- e2fd615ecc17 18.0 landed
On Wed, Oct 9, 2024 at 3:25 AM Bertrand Drouvot <bertranddrouvot.pg@gmail.com> wrote: > > Hi, > > On Tue, Oct 08, 2024 at 04:25:29PM +1100, Peter Smith wrote: > > 3. > > +postgres=# SELECT meta.* FROM pg_ls_logicalsnapdir(), > > +pg_get_logical_snapshot_meta(name) AS meta; > > + > > +-[ RECORD 1 ]-------- > > +magic | 1369563137 > > +checksum | 1028045905 > > +version | 6 > > > > 3a. > > If you are going to wrap the SQL across multiple lines like this, then > > you should show the psql continuation prompt, so that the example > > looks the same as what the user would see. > > I'm not sure about this one. If the user copy/paste the doc as it is then there > is no psql continuation prompt. If the user does not copy/paste the doc then he > might indeed see "something" else (but that's not surprising since he did not > copy/paste). FWIW, there is similar examples in pgstatstatements.sgml. > > > ~ > > > > 3b. > > FYI, the output of that can return multiple records, > > Yes, as the test in this patch does. > > > which is > > b.i) probably not what you intended to demonstrate > > b.ii) not the same as what the example says > > > > e.g., I got this: > > test_pub=# SELECT meta.* FROM pg_ls_logicalsnapdir(), > > test_pub-# pg_get_logical_snapshot_meta(name) AS meta; > > -[ RECORD 1 ]-------- > > magic | 1369563137 > > checksum | 681884630 > > version | 6 > > -[ RECORD 2 ]-------- > > magic | 1369563137 > > checksum | 2213048308 > > version | 6 > > -[ RECORD 3 ]-------- > > magic | 1369563137 > > checksum | 3812680762 > > version | 6 > > -[ RECORD 4 ]-------- > > magic | 1369563137 > > checksum | 3759893001 > > version | 6 > > > > I don't get the point here. The examples just show another way to use the functions, > the ouput is more "anecdotal" than anything else. > I mistakenly thought the purpose of the third part of the example was to give a shorthand way of doing the same as the first two parts -- so, using one SQL query instead of two. But unless this SQL is modified also to output the name of the/each snapfile then I'm not sure how these 3rd part examples are particularly useful. e.g. Without an associated filename, all this query will yield is a bunch of meta-data (or info-data) records but you have no idea which snapshots they belong to. How about doing this: SELECT ss.name, info.* FROM pg_ls_logicalsnapdir() AS ss, pg_get_logical_snapshot_info(ss.name) AS info; ====== Kind Regards, Peter Smith. Fujitsu Australia