public inbox for [email protected]help / color / mirror / Atom feed
[PATCH] xlog_block_info: show compression method 3+ messages / 2 participants [nested] [flat]
* [PATCH] xlog_block_info: show compression method @ 2022-02-19 17:35 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 3+ messages in thread From: Justin Pryzby @ 2022-02-19 17:35 UTC (permalink / raw) --- src/backend/access/transam/xlogrecovery.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/backend/access/transam/xlogrecovery.c b/src/backend/access/transam/xlogrecovery.c index 4ad145dd167..75a72b47f78 100644 --- a/src/backend/access/transam/xlogrecovery.c +++ b/src/backend/access/transam/xlogrecovery.c @@ -2238,7 +2238,20 @@ xlog_block_info(StringInfo buf, XLogReaderState *record) rlocator.relNumber, blk); if (XLogRecHasBlockImage(record, block_id)) - appendStringInfoString(buf, " FPW"); + { + if (!BKPIMAGE_COMPRESSED(record->blocks[block_id].bimg_info)) + appendStringInfoString(buf, " FPW"); + else + { + uint8 info = record->blocks[block_id].bimg_info; + char *compression = + (BKPIMAGE_COMPRESS_PGLZ & info) ? "pglz" : + (BKPIMAGE_COMPRESS_LZ4 & info) ? "lz4" : + (BKPIMAGE_COMPRESS_ZSTD & info) ? "zstd" : "unknown"; + + appendStringInfo(buf, " FPW, compression method: %s", compression); + } + } } } -- 2.17.1 --um2V5WpqCyd73IVb-- ^ permalink raw reply [nested|flat] 3+ messages in thread
* [PATCH] xlog_block_info: show compression method @ 2022-02-19 17:35 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 3+ messages in thread From: Justin Pryzby @ 2022-02-19 17:35 UTC (permalink / raw) --- src/backend/access/transam/xlogrecovery.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/backend/access/transam/xlogrecovery.c b/src/backend/access/transam/xlogrecovery.c index 4ad145dd167..75a72b47f78 100644 --- a/src/backend/access/transam/xlogrecovery.c +++ b/src/backend/access/transam/xlogrecovery.c @@ -2238,7 +2238,20 @@ xlog_block_info(StringInfo buf, XLogReaderState *record) rlocator.relNumber, blk); if (XLogRecHasBlockImage(record, block_id)) - appendStringInfoString(buf, " FPW"); + { + if (!BKPIMAGE_COMPRESSED(record->blocks[block_id].bimg_info)) + appendStringInfoString(buf, " FPW"); + else + { + uint8 info = record->blocks[block_id].bimg_info; + char *compression = + (BKPIMAGE_COMPRESS_PGLZ & info) ? "pglz" : + (BKPIMAGE_COMPRESS_LZ4 & info) ? "lz4" : + (BKPIMAGE_COMPRESS_ZSTD & info) ? "zstd" : "unknown"; + + appendStringInfo(buf, " FPW, compression method: %s", compression); + } + } } } -- 2.17.1 --um2V5WpqCyd73IVb-- ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Support prepared statement invalidation when result types change @ 2023-08-28 16:51 Jelte Fennema <[email protected]> 0 siblings, 0 replies; 3+ messages in thread From: Jelte Fennema @ 2023-08-28 16:51 UTC (permalink / raw) To: jian he <[email protected]>; +Cc: PostgreSQL Hackers <[email protected]> On Mon, 28 Aug 2023 at 11:27, jian he <[email protected]> wrote: > With parameters, it also works, only a tiny issue with error reporting. > > prepstmt2 | PREPARE prepstmt2(bigint) AS SELECT * FROM pcachetest > WHERE q1 = $1; | {bigint} | {bigint,bigint,bigint} > ERROR: column "q1" does not exist at character 61 > HINT: Perhaps you meant to reference the column "pcachetest.x1". > STATEMENT: execute prepstmt2(1); > > I think "character 61" refer to "PREPARE prepstmt2(bigint) AS SELECT * > FROM pcachetest WHERE q1 = $1;" > so maybe the STATEMENT is slightly misleading. Could you share the full set of commands that cause the reporting issue? I don't think my changes should impact this reporting, so I'm curious if this is a new issue, or an already existing one. ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2023-08-28 16:51 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2022-02-19 17:35 [PATCH] xlog_block_info: show compression method Justin Pryzby <[email protected]> 2022-02-19 17:35 [PATCH] xlog_block_info: show compression method Justin Pryzby <[email protected]> 2023-08-28 16:51 Re: Support prepared statement invalidation when result types change Jelte Fennema <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox