+
+ -B block
+ --block=block
+
+ Only display records that modify the given block. The relation must
+ also be provided with --relation or
+ -l .
+
+
+
+
-e end
--end=end
-
- -k block
- --block=block
-
- Only display records that modify the given block. The relation must
- also be provided with --relation or
- -l .
-
-
-
-
-F fork
--fork=fork
If provided, only display records that modify blocks in the given fork.
- The valid values are 0 for the main fork,
- 1 for the free space map,
- 2 for the visibility map,
- and 3 for the init fork.
-
-
-
-
-
- -l tblspc /db /rel
- --relation=tblspc /db /rel
-
- Only display records that modify blocks in the given relation. The
- relation is specified with tablespace OID, database OID, and relfilenode
- separated by slashes, for example 1234/12345/12345 .
- This is the same format used for relations in the program's output.
+ The valid values are main for the main fork,
+ fsm for the free space map,
+ vm for the visibility map,
+ and init for the init fork.
+
+ -R tblspc /db /rel
+ --relation=tblspc /db /rel
+
+ Only display records that modify blocks in the given relation. The
+ relation is specified with tablespace OID, database OID, and relfilenode
+ separated by slashes, for example 1234/12345/12345 .
+ This is the same format used for relations in the program's output.
+
+
+
+
-s start
--start=start
printf(_(" %s [OPTION]... [STARTSEG [ENDSEG]]\n"), progname);
printf(_("\nOptions:\n"));
printf(_(" -b, --bkp-details output detailed information about backup blocks\n"));
+ printf(_(" -B, --block=N with --relation, only show records that modify block N\n"));
printf(_(" -e, --end=RECPTR stop reading at WAL location RECPTR\n"));
printf(_(" -f, --follow keep retrying after reaching end of WAL\n"));
- printf(_(" -k, --block=N with --relation, only show records matching this block\n"));
- printf(_(" -F, --fork=N only show records matching a specific fork number\n"
- " (defaults to showing all)\n"));
- printf(_(" -l, --relation=N/N/N only show records that affect a specific relation\n"));
+ printf(_(" -F, --fork=FORK only show records that modify blocks in fork FORK;\n"
+ " valid names are main, fsm, vm, init\n"));
printf(_(" -n, --limit=N number of records to display\n"));
printf(_(" -p, --path=PATH directory in which to find log segment files or a\n"
" directory with a ./pg_wal that contains such files\n"
printf(_(" -q, --quiet do not print any output, except for errors\n"));
printf(_(" -r, --rmgr=RMGR only show records generated by resource manager RMGR;\n"
" use --rmgr=list to list valid resource manager names\n"));
+ printf(_(" -R, --relation=T/D/R only show records that modify blocks in relation T/D/R\n"));
printf(_(" -s, --start=RECPTR start reading at WAL location RECPTR\n"));
printf(_(" -t, --timeline=TLI timeline from which to read log records\n"
" (default: 1 or the value used in STARTSEG)\n"));
printf(_(" -V, --version output version information, then exit\n"));
- printf(_(" -x, --xid=XID only show records with transaction ID XID\n"));
printf(_(" -w, --fullpage only show records with a full page write\n"));
+ printf(_(" -x, --xid=XID only show records with transaction ID XID\n"));
printf(_(" -z, --stats[=record] show statistics instead of records\n"
" (optionally, show per-record statistics)\n"));
printf(_(" -?, --help show this help, then exit\n"));
static struct option long_options[] = {
{"bkp-details", no_argument, NULL, 'b'},
- {"block", required_argument, NULL, 'k '},
+ {"block", required_argument, NULL, 'B '},
{"end", required_argument, NULL, 'e'},
{"follow", no_argument, NULL, 'f'},
{"fork", required_argument, NULL, 'F'},
{"limit", required_argument, NULL, 'n'},
{"path", required_argument, NULL, 'p'},
{"quiet", no_argument, NULL, 'q'},
- {"relation", required_argument, NULL, 'l '},
+ {"relation", required_argument, NULL, 'R '},
{"rmgr", required_argument, NULL, 'r'},
{"start", required_argument, NULL, 's'},
{"timeline", required_argument, NULL, 't'},
goto bad_argument;
}
- while ((option = getopt_long(argc, argv, "be:fF:k:l:n:p:qr :s:t:wx:z",
+ while ((option = getopt_long(argc, argv, "bB:e:fF:n:p:qr:R :s:t:wx:z",
long_options, &optindex)) != -1)
{
switch (option)
case 'b':
config.bkp_details = true;
break;
+ case 'B':
+ if (sscanf(optarg, "%u", &config.filter_by_relation_block) != 1 ||
+ !BlockNumberIsValid(config.filter_by_relation_block))
+ {
+ pg_log_error("could not parse valid block number \"%s\"", optarg);
+ goto bad_argument;
+ }
+ config.filter_by_relation_block_enabled = true;
+ config.filter_by_extended = true;
+ break;
case 'e':
if (sscanf(optarg, "%X/%X", &xlogid, &xrecoff) != 2)
{
config.follow = true;
break;
case 'F':
+ config.filter_by_relation_forknum = forkname_to_number(optarg);
+ if (config.filter_by_relation_forknum == InvalidForkNumber)
{
- unsigned int forknum;
-
- if (sscanf(optarg, "%u", &forknum) != 1 ||
- forknum > MAX_FORKNUM)
- {
- pg_log_error("could not parse valid fork number (0..%d) \"%s\"",
- MAX_FORKNUM, optarg);
- goto bad_argument;
- }
- config.filter_by_relation_forknum = (ForkNumber) forknum;
- config.filter_by_extended = true;
- }
- break;
- case 'k':
- if (sscanf(optarg, "%u", &config.filter_by_relation_block) != 1 ||
- !BlockNumberIsValid(config.filter_by_relation_block))
- {
- pg_log_error("could not parse valid block number \"%s\"", optarg);
- goto bad_argument;
- }
- config.filter_by_relation_block_enabled = true;
- config.filter_by_extended = true;
- break;
- case 'l':
- if (sscanf(optarg, "%u/%u/%u",
- &config.filter_by_relation.spcNode,
- &config.filter_by_relation.dbNode,
- &config.filter_by_relation.relNode) != 3 ||
- !OidIsValid(config.filter_by_relation.spcNode) ||
- !OidIsValid(config.filter_by_relation.relNode))
- {
- pg_log_error("could not parse valid relation from \"%s\""
- " (expecting \"tablespace OID/database OID/"
- "relation filenode\")", optarg);
+ pg_log_error("could not parse fork \"%s\"", optarg);
goto bad_argument;
}
- config.filter_by_relation_enabled = true;
config.filter_by_extended = true;
break;
case 'n':
}
}
break;
+ case 'R':
+ if (sscanf(optarg, "%u/%u/%u",
+ &config.filter_by_relation.spcNode,
+ &config.filter_by_relation.dbNode,
+ &config.filter_by_relation.relNode) != 3 ||
+ !OidIsValid(config.filter_by_relation.spcNode) ||
+ !OidIsValid(config.filter_by_relation.relNode))
+ {
+ pg_log_error("could not parse valid relation from \"%s\""
+ " (expecting \"tablespace OID/database OID/"
+ "relation filenode\")", optarg);
+ goto bad_argument;
+ }
+ config.filter_by_relation_enabled = true;
+ config.filter_by_extended = true;
+ break;
case 's':
if (sscanf(optarg, "%X/%X", &xlogid, &xrecoff) != 2)
{