public inbox for [email protected]  
help / color / mirror / Atom feed
[PATCH] Highlight that pg_receivewal doesn't acknowledge that WAL has been applied, and as such synchronous-commit needs to be remote_write or lower.
6+ messages / 2 participants
[nested] [flat]

* [PATCH] Highlight that pg_receivewal doesn't acknowledge that WAL has been applied, and as such synchronous-commit needs to be remote_write or lower.
@ 2019-06-27 13:54  jesperpedersen <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: jesperpedersen @ 2019-06-27 13:54 UTC (permalink / raw)

Author: Jesper Pedersen <[email protected]>
---
 doc/src/sgml/ref/pg_receivewal.sgml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/doc/src/sgml/ref/pg_receivewal.sgml b/doc/src/sgml/ref/pg_receivewal.sgml
index 0506120c00..132a599d1b 100644
--- a/doc/src/sgml/ref/pg_receivewal.sgml
+++ b/doc/src/sgml/ref/pg_receivewal.sgml
@@ -207,6 +207,14 @@ PostgreSQL documentation
         server as a synchronous standby, to ensure that timely feedback is
         sent to the server.
        </para>
+
+       <para>
+        Note, that <application>pg_receivewal</application> doesn't acknowledge
+        that the Write-Ahead Log (<xref linkend="wal-intro"/>) has been applied, so
+        <xref linkend="guc-synchronous-commit"/> needs to have a setting
+        of <literal>remote_write</literal> or lower, if <application>pg_receivewal</application>
+        is the only standby.
+       </para>
       </listitem>
      </varlistentry>
 
-- 
2.21.0


--------------8595400030F027059703A7ED--





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* [PATCH] Highlight that pg_receivewal doesn't acknowledge that WAL has been applied, and as such synchronous-commit needs to be remote_write or lower.
@ 2019-07-09 17:14  jesperpedersen <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: jesperpedersen @ 2019-07-09 17:14 UTC (permalink / raw)

Authors: Laurenz Albe and Jesper Pedersen
Review-by: Laurenz Albe
---
 doc/src/sgml/ref/pg_receivewal.sgml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/doc/src/sgml/ref/pg_receivewal.sgml b/doc/src/sgml/ref/pg_receivewal.sgml
index 0506120c00..46605db662 100644
--- a/doc/src/sgml/ref/pg_receivewal.sgml
+++ b/doc/src/sgml/ref/pg_receivewal.sgml
@@ -207,6 +207,13 @@ PostgreSQL documentation
         server as a synchronous standby, to ensure that timely feedback is
         sent to the server.
        </para>
+
+       <para>
+        Note that while WAL will be flushed with this setting,
+        it will never be applied, so <xref linkend="guc-synchronous-commit"/> must
+        not be set to <literal>remote_apply</literal> if <application>pg_receivewal</application>
+        is the only synchronous standby.
+       </para>
       </listitem>
      </varlistentry>
 
-- 
2.21.0


--------------90B8544CAFB7167FB0FB8438--





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* [PATCH v1 2/3] Add const to read only TableInfo pointers in pg_dump
@ 2025-12-18 12:47  Bertrand Drouvot <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Bertrand Drouvot @ 2025-12-18 12:47 UTC (permalink / raw)

Functions that dump table data receive their parameters through const void *
but were casting away const. Add const qualifiers to functions that only read
the table information.

Also change getRootTableInfo to return const TableInfo *, since it only traverses
the parent chain without modifying any TableInfo structures. This allows the dump
functions to maintain const correctness when calling it.
---
 src/bin/pg_dump/pg_dump.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
 100.0% src/bin/pg_dump/

diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 24ad201af2f..6aecc8b32fd 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -412,7 +412,7 @@ static void appendReloptionsArrayAH(PQExpBuffer buffer, const char *reloptions,
 static char *get_synchronized_snapshot(Archive *fout);
 static void set_restrict_relation_kind(Archive *AH, const char *value);
 static void setupDumpWorker(Archive *AH);
-static TableInfo *getRootTableInfo(const TableInfo *tbinfo);
+static const TableInfo *getRootTableInfo(const TableInfo *tbinfo);
 static bool forcePartitionRootLoad(const TableInfo *tbinfo);
 static void read_dump_filters(const char *filename, DumpOptions *dopt);
 
@@ -2379,8 +2379,8 @@ selectDumpableObject(DumpableObject *dobj, Archive *fout)
 static int
 dumpTableData_copy(Archive *fout, const void *dcontext)
 {
-	TableDataInfo *tdinfo = (TableDataInfo *) dcontext;
-	TableInfo  *tbinfo = tdinfo->tdtable;
+	const TableDataInfo *tdinfo = (const TableDataInfo *) dcontext;
+	const TableInfo *tbinfo = tdinfo->tdtable;
 	const char *classname = tbinfo->dobj.name;
 	PQExpBuffer q = createPQExpBuffer();
 
@@ -2547,8 +2547,8 @@ dumpTableData_copy(Archive *fout, const void *dcontext)
 static int
 dumpTableData_insert(Archive *fout, const void *dcontext)
 {
-	TableDataInfo *tdinfo = (TableDataInfo *) dcontext;
-	TableInfo  *tbinfo = tdinfo->tdtable;
+	const TableDataInfo *tdinfo = (const TableDataInfo *) dcontext;
+	const TableInfo *tbinfo = tdinfo->tdtable;
 	DumpOptions *dopt = fout->dopt;
 	PQExpBuffer q = createPQExpBuffer();
 	PQExpBuffer insertStmt = NULL;
@@ -2618,7 +2618,7 @@ dumpTableData_insert(Archive *fout, const void *dcontext)
 		 */
 		if (insertStmt == NULL)
 		{
-			TableInfo  *targettab;
+			const TableInfo *targettab;
 
 			insertStmt = createPQExpBuffer();
 
@@ -2813,10 +2813,10 @@ dumpTableData_insert(Archive *fout, const void *dcontext)
  * getRootTableInfo:
  *     get the root TableInfo for the given partition table.
  */
-static TableInfo *
+static const TableInfo *
 getRootTableInfo(const TableInfo *tbinfo)
 {
-	TableInfo  *parentTbinfo;
+	const TableInfo *parentTbinfo;
 
 	Assert(tbinfo->ispartition);
 	Assert(tbinfo->numParents == 1);
@@ -2870,7 +2870,7 @@ static void
 dumpTableData(Archive *fout, const TableDataInfo *tdinfo)
 {
 	DumpOptions *dopt = fout->dopt;
-	TableInfo  *tbinfo = tdinfo->tdtable;
+	const TableInfo *tbinfo = tdinfo->tdtable;
 	PQExpBuffer copyBuf = createPQExpBuffer();
 	PQExpBuffer clistBuf = createPQExpBuffer();
 	DataDumperPtr dumpFn;
@@ -2891,7 +2891,7 @@ dumpTableData(Archive *fout, const TableDataInfo *tdinfo)
 		(dopt->load_via_partition_root ||
 		 forcePartitionRootLoad(tbinfo)))
 	{
-		TableInfo  *parentTbinfo;
+		const TableInfo *parentTbinfo;
 		char	   *sanitized;
 
 		parentTbinfo = getRootTableInfo(tbinfo);
-- 
2.34.1


--jEYXENy/7KdvfqDm
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
	filename="v1-0003-Separate-read-and-write-pointers-in-pg_saslprep.patch"



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* [PATCH v2 2/3] Add const to read only TableInfo pointers in pg_dump
@ 2025-12-18 12:47  Bertrand Drouvot <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Bertrand Drouvot @ 2025-12-18 12:47 UTC (permalink / raw)

Functions that dump table data receive their parameters through const void *
but were casting away const. Add const qualifiers to functions that only read
the table information.

Also change getRootTableInfo to return const TableInfo *, since it only traverses
the parent chain without modifying any TableInfo structures. This allows the dump
functions to maintain const correctness when calling it.

Discussion: https://postgr.es/m/aUQHy/MmWq7c97wK%40ip-10-97-1-34.eu-west-3.compute.internal
---
 src/bin/pg_dump/pg_dump.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
 100.0% src/bin/pg_dump/

diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 27f6be3f0f8..3f5e917ad99 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -412,7 +412,7 @@ static void appendReloptionsArrayAH(PQExpBuffer buffer, const char *reloptions,
 static char *get_synchronized_snapshot(Archive *fout);
 static void set_restrict_relation_kind(Archive *AH, const char *value);
 static void setupDumpWorker(Archive *AH);
-static TableInfo *getRootTableInfo(const TableInfo *tbinfo);
+static const TableInfo *getRootTableInfo(const TableInfo *tbinfo);
 static bool forcePartitionRootLoad(const TableInfo *tbinfo);
 static void read_dump_filters(const char *filename, DumpOptions *dopt);
 
@@ -2379,8 +2379,8 @@ selectDumpableObject(DumpableObject *dobj, Archive *fout)
 static int
 dumpTableData_copy(Archive *fout, const void *dcontext)
 {
-	TableDataInfo *tdinfo = (TableDataInfo *) dcontext;
-	TableInfo  *tbinfo = tdinfo->tdtable;
+	const TableDataInfo *tdinfo = dcontext;
+	const TableInfo *tbinfo = tdinfo->tdtable;
 	const char *classname = tbinfo->dobj.name;
 	PQExpBuffer q = createPQExpBuffer();
 
@@ -2547,8 +2547,8 @@ dumpTableData_copy(Archive *fout, const void *dcontext)
 static int
 dumpTableData_insert(Archive *fout, const void *dcontext)
 {
-	TableDataInfo *tdinfo = (TableDataInfo *) dcontext;
-	TableInfo  *tbinfo = tdinfo->tdtable;
+	const TableDataInfo *tdinfo = dcontext;
+	const TableInfo *tbinfo = tdinfo->tdtable;
 	DumpOptions *dopt = fout->dopt;
 	PQExpBuffer q = createPQExpBuffer();
 	PQExpBuffer insertStmt = NULL;
@@ -2618,7 +2618,7 @@ dumpTableData_insert(Archive *fout, const void *dcontext)
 		 */
 		if (insertStmt == NULL)
 		{
-			TableInfo  *targettab;
+			const TableInfo *targettab;
 
 			insertStmt = createPQExpBuffer();
 
@@ -2813,10 +2813,10 @@ dumpTableData_insert(Archive *fout, const void *dcontext)
  * getRootTableInfo:
  *     get the root TableInfo for the given partition table.
  */
-static TableInfo *
+static const TableInfo *
 getRootTableInfo(const TableInfo *tbinfo)
 {
-	TableInfo  *parentTbinfo;
+	const TableInfo *parentTbinfo;
 
 	Assert(tbinfo->ispartition);
 	Assert(tbinfo->numParents == 1);
@@ -2870,7 +2870,7 @@ static void
 dumpTableData(Archive *fout, const TableDataInfo *tdinfo)
 {
 	DumpOptions *dopt = fout->dopt;
-	TableInfo  *tbinfo = tdinfo->tdtable;
+	const TableInfo *tbinfo = tdinfo->tdtable;
 	PQExpBuffer copyBuf = createPQExpBuffer();
 	PQExpBuffer clistBuf = createPQExpBuffer();
 	DataDumperPtr dumpFn;
@@ -2891,7 +2891,7 @@ dumpTableData(Archive *fout, const TableDataInfo *tdinfo)
 		(dopt->load_via_partition_root ||
 		 forcePartitionRootLoad(tbinfo)))
 	{
-		TableInfo  *parentTbinfo;
+		const TableInfo *parentTbinfo;
 		char	   *sanitized;
 
 		parentTbinfo = getRootTableInfo(tbinfo);
-- 
2.34.1


--IBFQ0J+7bhRCocF6
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
	filename="v2-0003-Separate-read-and-write-pointers-in-pg_saslprep.patch"



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* [PATCH v3 2/2] Add const to read only TableInfo pointers in pg_dump
@ 2025-12-18 12:47  Bertrand Drouvot <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Bertrand Drouvot @ 2025-12-18 12:47 UTC (permalink / raw)

Functions that dump table data receive their parameters through const void *
but were casting away const. Add const qualifiers to functions that only read
the table information.

Discussion: https://postgr.es/m/aUQHy/MmWq7c97wK%40ip-10-97-1-34.eu-west-3.compute.internal
---
 src/bin/pg_dump/pg_dump.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
 100.0% src/bin/pg_dump/

diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 7df56d8b1b0..e3b4035e57a 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -2379,8 +2379,8 @@ selectDumpableObject(DumpableObject *dobj, Archive *fout)
 static int
 dumpTableData_copy(Archive *fout, const void *dcontext)
 {
-	TableDataInfo *tdinfo = (TableDataInfo *) dcontext;
-	TableInfo  *tbinfo = tdinfo->tdtable;
+	const TableDataInfo *tdinfo = dcontext;
+	const TableInfo *tbinfo = tdinfo->tdtable;
 	const char *classname = tbinfo->dobj.name;
 	PQExpBuffer q = createPQExpBuffer();
 
@@ -2547,8 +2547,8 @@ dumpTableData_copy(Archive *fout, const void *dcontext)
 static int
 dumpTableData_insert(Archive *fout, const void *dcontext)
 {
-	TableDataInfo *tdinfo = (TableDataInfo *) dcontext;
-	TableInfo  *tbinfo = tdinfo->tdtable;
+	const TableDataInfo *tdinfo = dcontext;
+	const TableInfo *tbinfo = tdinfo->tdtable;
 	DumpOptions *dopt = fout->dopt;
 	PQExpBuffer q = createPQExpBuffer();
 	PQExpBuffer insertStmt = NULL;
@@ -2618,7 +2618,7 @@ dumpTableData_insert(Archive *fout, const void *dcontext)
 		 */
 		if (insertStmt == NULL)
 		{
-			TableInfo  *targettab;
+			const TableInfo *targettab;
 
 			insertStmt = createPQExpBuffer();
 
@@ -2870,7 +2870,7 @@ static void
 dumpTableData(Archive *fout, const TableDataInfo *tdinfo)
 {
 	DumpOptions *dopt = fout->dopt;
-	TableInfo  *tbinfo = tdinfo->tdtable;
+	const TableInfo *tbinfo = tdinfo->tdtable;
 	PQExpBuffer copyBuf = createPQExpBuffer();
 	PQExpBuffer clistBuf = createPQExpBuffer();
 	DataDumperPtr dumpFn;
@@ -2891,7 +2891,7 @@ dumpTableData(Archive *fout, const TableDataInfo *tdinfo)
 		(dopt->load_via_partition_root ||
 		 forcePartitionRootLoad(tbinfo)))
 	{
-		TableInfo  *parentTbinfo;
+		const TableInfo *parentTbinfo;
 		char	   *sanitized;
 
 		parentTbinfo = getRootTableInfo(tbinfo);
-- 
2.34.1


--z8zicCKlggXCVSIM--





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* [PATCH v3 2/2] Add const to read only TableInfo pointers in pg_dump
@ 2025-12-18 12:47  Bertrand Drouvot <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Bertrand Drouvot @ 2025-12-18 12:47 UTC (permalink / raw)

Functions that dump table data receive their parameters through const void *
but were casting away const. Add const qualifiers to functions that only read
the table information.

Discussion: https://postgr.es/m/aUQHy/MmWq7c97wK%40ip-10-97-1-34.eu-west-3.compute.internal
---
 src/bin/pg_dump/pg_dump.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
 100.0% src/bin/pg_dump/

diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 7df56d8b1b0..e3b4035e57a 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -2379,8 +2379,8 @@ selectDumpableObject(DumpableObject *dobj, Archive *fout)
 static int
 dumpTableData_copy(Archive *fout, const void *dcontext)
 {
-	TableDataInfo *tdinfo = (TableDataInfo *) dcontext;
-	TableInfo  *tbinfo = tdinfo->tdtable;
+	const TableDataInfo *tdinfo = dcontext;
+	const TableInfo *tbinfo = tdinfo->tdtable;
 	const char *classname = tbinfo->dobj.name;
 	PQExpBuffer q = createPQExpBuffer();
 
@@ -2547,8 +2547,8 @@ dumpTableData_copy(Archive *fout, const void *dcontext)
 static int
 dumpTableData_insert(Archive *fout, const void *dcontext)
 {
-	TableDataInfo *tdinfo = (TableDataInfo *) dcontext;
-	TableInfo  *tbinfo = tdinfo->tdtable;
+	const TableDataInfo *tdinfo = dcontext;
+	const TableInfo *tbinfo = tdinfo->tdtable;
 	DumpOptions *dopt = fout->dopt;
 	PQExpBuffer q = createPQExpBuffer();
 	PQExpBuffer insertStmt = NULL;
@@ -2618,7 +2618,7 @@ dumpTableData_insert(Archive *fout, const void *dcontext)
 		 */
 		if (insertStmt == NULL)
 		{
-			TableInfo  *targettab;
+			const TableInfo *targettab;
 
 			insertStmt = createPQExpBuffer();
 
@@ -2870,7 +2870,7 @@ static void
 dumpTableData(Archive *fout, const TableDataInfo *tdinfo)
 {
 	DumpOptions *dopt = fout->dopt;
-	TableInfo  *tbinfo = tdinfo->tdtable;
+	const TableInfo *tbinfo = tdinfo->tdtable;
 	PQExpBuffer copyBuf = createPQExpBuffer();
 	PQExpBuffer clistBuf = createPQExpBuffer();
 	DataDumperPtr dumpFn;
@@ -2891,7 +2891,7 @@ dumpTableData(Archive *fout, const TableDataInfo *tdinfo)
 		(dopt->load_via_partition_root ||
 		 forcePartitionRootLoad(tbinfo)))
 	{
-		TableInfo  *parentTbinfo;
+		const TableInfo *parentTbinfo;
 		char	   *sanitized;
 
 		parentTbinfo = getRootTableInfo(tbinfo);
-- 
2.34.1


--z8zicCKlggXCVSIM--





^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2025-12-18 12:47 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-06-27 13:54 [PATCH] Highlight that pg_receivewal doesn't acknowledge that WAL has been applied, and as such synchronous-commit needs to be remote_write or lower. jesperpedersen <[email protected]>
2019-07-09 17:14 [PATCH] Highlight that pg_receivewal doesn't acknowledge that WAL has been applied, and as such synchronous-commit needs to be remote_write or lower. jesperpedersen <[email protected]>
2025-12-18 12:47 [PATCH v3 2/2] Add const to read only TableInfo pointers in pg_dump Bertrand Drouvot <[email protected]>
2025-12-18 12:47 [PATCH v3 2/2] Add const to read only TableInfo pointers in pg_dump Bertrand Drouvot <[email protected]>
2025-12-18 12:47 [PATCH v1 2/3] Add const to read only TableInfo pointers in pg_dump Bertrand Drouvot <[email protected]>
2025-12-18 12:47 [PATCH v2 2/3] Add const to read only TableInfo pointers in pg_dump Bertrand Drouvot <[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