public inbox for [email protected]
help / color / mirror / Atom feedSmall fixes for CHECKPOINT FLUSH_UNLOGGED
2+ messages / 2 participants
[nested] [flat]
* Small fixes for CHECKPOINT FLUSH_UNLOGGED
@ 2026-05-25 07:07 Chao Li <[email protected]>
2026-05-25 07:57 ` Re: Small fixes for CHECKPOINT FLUSH_UNLOGGED Daniel Gustafsson <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Chao Li @ 2026-05-25 07:07 UTC (permalink / raw)
To: PostgreSQL Hackers <[email protected]>; +Cc: Nathan Bossart <[email protected]>; Christoph Berg <[email protected]>
Hi,
I just tested “Add FLUSH_UNLOGGED option to CHECKPOINT command”, and found no functional issue. I only noticed a couple of small issues.
1. Tab-completion for FLUSH_UNLOGGED misses its boolean value
FLUSH_UNLOGGED can take a boolean value, but tab completion does not suggest ON/OFF for it. For comparison, REPACK does:
```
evantest=# checkpoint (FLUSH_UNLOGGED o
evantest=# repack (concurrently O
OFF ON
```The fix just follows the existing code for REPACK. After the fix:
```
evantest=# checkpoint (flush_unlogged O
OFF ON
```
2. The CHECKPOINT doc still says “All data files will be flushed to disk”
After introducing FLUSH_UNLOGGED, CHECKPOINT by default no longer flushes dirty buffers of unlogged relations, but checkpoint.sgml still says “All data files will be flushed to disk.” That seems stale, so I updated the doc.
These are two small changes, but to make the patch easier to process, I split them into two commits.
Best reagards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
Attachments:
[application/octet-stream] v1-0002-doc-Clarify-CHECKPOINT-handling-of-unlogged-buffe.patch (1.6K, 2-v1-0002-doc-Clarify-CHECKPOINT-handling-of-unlogged-buffe.patch)
download | inline diff:
From 8e18462c160a45ebf0cec535b6ab48c0fed942c4 Mon Sep 17 00:00:00 2001
From: "Chao Li (Evan)" <[email protected]>
Date: Mon, 25 May 2026 14:30:41 +0800
Subject: [PATCH v1 2/2] doc: Clarify CHECKPOINT handling of unlogged buffers
The CHECKPOINT reference page still described checkpoints as flushing all
data files, which became misleading after adding the FLUSH_UNLOGGED
option. By default, manual checkpoints flush dirty buffers for permanent
relations but do not flush dirty buffers of unlogged relations.
Update the description to mention that exception and point readers to
FLUSH_UNLOGGED when they want unlogged buffers flushed too.
Author: Chao Li <[email protected]>
---
doc/src/sgml/ref/checkpoint.sgml | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/doc/src/sgml/ref/checkpoint.sgml b/doc/src/sgml/ref/checkpoint.sgml
index cd981cf2cab..a43a1913b41 100644
--- a/doc/src/sgml/ref/checkpoint.sgml
+++ b/doc/src/sgml/ref/checkpoint.sgml
@@ -35,8 +35,10 @@ CHECKPOINT [ ( option [, ...] ) ]
<para>
A checkpoint is a point in the write-ahead log sequence at which
- all data files have been updated to reflect the information in the
- log. All data files will be flushed to disk. Refer to
+ data files for permanent relations have been updated to reflect the
+ information in the log. Those data files will be flushed to disk.
+ Dirty buffers of unlogged relations are normally not flushed unless
+ <literal>FLUSH_UNLOGGED</literal> is specified. Refer to
<xref linkend="wal-configuration"/> for more details about what happens
during a checkpoint.
</para>
--
2.50.1 (Apple Git-155)
[application/octet-stream] v1-0001-psql-Complete-boolean-values-for-CHECKPOINT-FLUSH.patch (1.1K, 3-v1-0001-psql-Complete-boolean-values-for-CHECKPOINT-FLUSH.patch)
download | inline diff:
From afbc48bcc06d5668b8a3db3a0b3caba4a0f8a4a0 Mon Sep 17 00:00:00 2001
From: "Chao Li (Evan)" <[email protected]>
Date: Mon, 25 May 2026 14:14:26 +0800
Subject: [PATCH v1 1/2] psql: Complete boolean values for CHECKPOINT
FLUSH_UNLOGGED
Tab completion for CHECKPOINT option lists suggested FLUSH_UNLOGGED, but
once that option had been entered it did not offer the accepted boolean
values. Add ON/OFF completion, matching other parenthesized boolean
option-list completions.
Author: Chao Li <[email protected]>
---
src/bin/psql/tab-complete.in.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/bin/psql/tab-complete.in.c b/src/bin/psql/tab-complete.in.c
index 364546c13e8..de547a8cb37 100644
--- a/src/bin/psql/tab-complete.in.c
+++ b/src/bin/psql/tab-complete.in.c
@@ -3274,6 +3274,8 @@ match_previous_words(int pattern_id,
COMPLETE_WITH("MODE", "FLUSH_UNLOGGED");
else if (TailMatches("MODE"))
COMPLETE_WITH("FAST", "SPREAD");
+ else if (TailMatches("FLUSH_UNLOGGED"))
+ COMPLETE_WITH("ON", "OFF");
}
/* CLOSE */
else if (Matches("CLOSE"))
--
2.50.1 (Apple Git-155)
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Small fixes for CHECKPOINT FLUSH_UNLOGGED
2026-05-25 07:07 Small fixes for CHECKPOINT FLUSH_UNLOGGED Chao Li <[email protected]>
@ 2026-05-25 07:57 ` Daniel Gustafsson <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Gustafsson @ 2026-05-25 07:57 UTC (permalink / raw)
To: Chao Li <[email protected]>; +Cc: PostgreSQL Hackers <[email protected]>; Nathan Bossart <[email protected]>; Christoph Berg <[email protected]>
> On 25 May 2026, at 09:07, Chao Li <[email protected]> wrote:
> These are two small changes, but to make the patch easier to process, I split them into two commits.
Thanks for testing and fixing. Both LGTM, will test a little and then apply
(perhaps with some editorializing on the docs patch).
--
Daniel Gustafsson
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2026-05-25 07:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-05-25 07:07 Small fixes for CHECKPOINT FLUSH_UNLOGGED Chao Li <[email protected]>
2026-05-25 07:57 ` Daniel Gustafsson <[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