public inbox for [email protected]  
help / color / mirror / Atom feed
[PATCH 03/12] psql: Add HIDE_COMPRESSAM for regress testing
67+ messages / 6 participants
[nested] [flat]

* [PATCH 03/12] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--9Ek0hoCL9XbhcSqy
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="0004-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--YZ5djTAD1cGYuMQK
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing
@ 2021-02-14 02:48  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Justin Pryzby @ 2021-02-14 02:48 UTC (permalink / raw)

This avoids churn in regression output, and allows testing with alternate
compression AMs.
---
 doc/src/sgml/ref/psql-ref.sgml     | 11 +++++++++++
 src/bin/psql/describe.c            |  1 +
 src/bin/psql/help.c                |  2 ++
 src/bin/psql/settings.h            |  1 +
 src/bin/psql/startup.c             |  9 +++++++++
 src/test/regress/pg_regress_main.c |  4 ++--
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 13c1edfa4d..66dcb1b33b 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -3863,6 +3863,17 @@ bar
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HIDE_COMPRESSAM</varname></term>
+        <listitem>
+        <para>
+         If this variable is set to <literal>true</literal>, column's
+         compression access method details are not displayed. This is mainly
+         useful for regression tests.
+        </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>HIDE_TABLEAM</varname></term>
         <listitem>
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index ba464d463e..b835b0cf76 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1897,6 +1897,7 @@ describeOneTableDetails(const char *schemaname,
 
 		/* compresssion info */
 		if (pset.sversion >= 140000 &&
+			!pset.hide_compressam &&
 			(tableinfo.relkind == RELKIND_RELATION ||
 			 tableinfo.relkind == RELKIND_PARTITIONED_TABLE ||
 			 tableinfo.relkind == RELKIND_MATVIEW))
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf76..a818ee5503 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -375,6 +375,8 @@ helpVariables(unsigned short int pager)
 					  "    true if last query failed, else false\n"));
 	fprintf(output, _("  FETCH_COUNT\n"
 					  "    the number of result rows to fetch and display at a time (0 = unlimited)\n"));
+	fprintf(output, _("  HIDE_COMPRESSAM\n"
+					  "    if set, compression access methods are not displayed\n"));
 	fprintf(output, _("  HIDE_TABLEAM\n"
 					  "    if set, table access methods are not displayed\n"));
 	fprintf(output, _("  HISTCONTROL\n"
diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h
index d65990059d..9755e8eac6 100644
--- a/src/bin/psql/settings.h
+++ b/src/bin/psql/settings.h
@@ -134,6 +134,7 @@ typedef struct _psqlSettings
 	bool		quiet;
 	bool		singleline;
 	bool		singlestep;
+	bool		hide_compressam;
 	bool		hide_tableam;
 	int			fetch_count;
 	int			histsize;
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 780479c8d7..554b64367d 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -1159,6 +1159,12 @@ show_context_hook(const char *newval)
 	return true;
 }
 
+static bool
+hide_compressam_hook(const char *newval)
+{
+	return ParseVariableBool(newval, "HIDE_COMPRESSAM", &pset.hide_compressam);
+}
+
 static bool
 hide_tableam_hook(const char *newval)
 {
@@ -1227,6 +1233,9 @@ EstablishVariableSpace(void)
 	SetVariableHooks(pset.vars, "SHOW_CONTEXT",
 					 show_context_substitute_hook,
 					 show_context_hook);
+	SetVariableHooks(pset.vars, "HIDE_COMPRESSAM",
+					 bool_substitute_hook,
+					 hide_compressam_hook);
 	SetVariableHooks(pset.vars, "HIDE_TABLEAM",
 					 bool_substitute_hook,
 					 hide_tableam_hook);
diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c
index 8dc4941c24..07fd3f6a4d 100644
--- a/src/test/regress/pg_regress_main.c
+++ b/src/test/regress/pg_regress_main.c
@@ -78,11 +78,11 @@ psql_start_test(const char *testname,
 	 * against different AMs without unnecessary differences.
 	 */
 	offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
-					   "\"%s%spsql\" -X -a -q -d \"%s\" -v %s < \"%s\" > \"%s\" 2>&1",
+					   "\"%s%spsql\" -X -a -q -d \"%s\" %s < \"%s\" > \"%s\" 2>&1",
 					   bindir ? bindir : "",
 					   bindir ? "/" : "",
 					   dblist->str,
-					   "HIDE_TABLEAM=\"on\"",
+					   "-v HIDE_TABLEAM=on -v HIDE_COMPRESSAM=on",
 					   infile,
 					   outfile);
 	if (offset >= sizeof(psql_cmd))
-- 
2.17.0


--m51xatjYGsM+13rf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
 filename="v24-0003-Add-default_toast_compression-GUC.patch"



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

* Re: Add pg_stat_kind_info system view
@ 2026-05-28 17:11  Tristan Partin <[email protected]>
  1 sibling, 1 reply; 67+ messages in thread

From: Tristan Partin @ 2026-05-28 17:11 UTC (permalink / raw)
  To: Michael Paquier <[email protected]>; +Cc: pgsql-hackers; Bertrand Drouvot <[email protected]>

On Thu May 14, 2026 at 5:30 AM UTC, Michael Paquier wrote:
> On Thu, Apr 30, 2026 at 07:38:57PM +0000, Tristan Partin wrote:
>> Of course I forgot to attach the patch :D.
>
> Thanks for the patch.  That sounds like a good idea particularly for
> track_entry_count, because we have no real way to provide this
> information, which would be more valuable if an in-core stats kind has
> the idea to switch this flag to true in the future, and I don't really
> want all extensions to re-implement the same thing to access this
> information.
>
> +            if (info->track_entry_count)
> +            {
> +                values[2] = Int64GetDatum(pgstat_get_entry_count(kind));
> +            }
> +            else
> +            {
> +                nulls[2] = true;
> +            }
>
> Returning NULL if the flag is not set sounds sensible.  For
> fixed-numbered, fine by me for 1, so as it is possible to aggregate
> the full size counting with the fixed shmem size of each stats kind.

Awesome.

> +SELECT name, builtin FROM pg_stat_kind_info
> +  ORDER BY name COLLATE "C";
>
> This is not going to be stable if running installcheck on an instance
> where a custom kind is loaded, so let's restrict the query to check
> for built-in kinds.

I'll fix this in v2, which I will send after resolving more discussion. 
I had not considered this as a potential problem. I'll remove the 
builtin column from the SELECT and filter on builtin as suggested.

> I'd suggest to expand the data published to more fields and not only
> what's presented here, so as it becomes possible to do more SQL sanity
> checks with the stats kind info (same attribute name as the fields):
> - fixed_amount, where shared_size > 0 does not make sense.
> - snapshot_ctl_off and shared_ctl_off, that only makes sense under
> fixed_amount.  These should not be set for !fixed_amount.
> - pending_size, that should not be set for fixed_amount.
> - existence of flush_pending_cb, delete_pending_cb,
> reset_timestamp_cb, to_serialized_name, from_serialized_name,
> to_serialized_data, from_serialized_data (should be booleans), fine
> for !fixed_amount, never for fixed_amount.
> - existence of init_shmem_cb, reset_all_cb, snapshot_cb (should be
> booleans), fine for fixed_amount, never for !fixed_amount.

Can you share how someone might use this additional information? I can 
see some inherent value for additionally exposing:

- fixed_amount
- accessed_across_databases
- write_to_file
- snapshot_ctl_off
- shared_ctl_off
- shared_data_off
- shared_data_len
- pending_size

> I may be missing one or two things.  pgstat_internal.h documents all
> these requirements, the idea is to translate these requirements at SQL
> level.  We should definitely apply these checks for both custom and
> built-in stats kinds, which should save time for developers of pgstats
> in core and outside of core by detecting inconsistent patterns
> beforehand.

Not sure I understand why we would want to expose the existence of the 
callbacks to make assertions at the SQL level. I see that in 
pgstat_register_kind(), we have the following code:

	/*
	 * Check some data for fixed-numbered stats.
	 */
	if (kind_info->fixed_amount)
	{
		if (kind_info->shared_size == 0)
			ereport(ERROR,
					(errmsg("custom cumulative statistics property is invalid"),
					 errhint("Custom cumulative statistics require a shared memory size for fixed-numbered objects.")));
		if (kind_info->track_entry_count)
			ereport(ERROR,
					(errmsg("custom cumulative statistics property is invalid"),
					 errhint("Custom cumulative statistics cannot use entry count tracking for fixed-numbered objects.")));
	}

We could extend these invariant checks to make sure that the callbacks 
are only set when fixed_amount is true for instance. I am very much open 
to having my mind changed.

-- 
Tristan Partin
PostgreSQL Contributors Team
AWS (https://aws.amazon.com)






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

* Re: Add pg_stat_kind_info system view
@ 2026-06-01 05:40  Michael Paquier <[email protected]>
  parent: Tristan Partin <[email protected]>
  0 siblings, 1 reply; 67+ messages in thread

From: Michael Paquier @ 2026-06-01 05:40 UTC (permalink / raw)
  To: Tristan Partin <[email protected]>; +Cc: pgsql-hackers; Bertrand Drouvot <[email protected]>

On Thu, May 28, 2026 at 05:11:42PM +0000, Tristan Partin wrote:
> Can you share how someone might use this additional information?
>
> Not sure I understand why we would want to expose the existence of the 
> callbacks to make assertions at the SQL level. I see that in 
> pgstat_register_kind(), we have the following code:
> 
> We could extend these invariant checks to make sure that the callbacks 
> are only set when fixed_amount is true for instance. I am very much open 
> to having my mind changed.

There is currently no internal mechanism to make sure that the
built-in stats kinds have a consistent setup in terms of flags and
callbacks set, so for developers we could immediately complain when
generating patches that add new stats kinds.  For custom stats kinds,
loaded libraries could have more cross-checks.

Perhaps it is not worth bothering at the end, and I'd be fine to keep
the data published as minimal as you see fit.  Still, fixed_amount,
write_to_file and accessed_across_databases feel like useful
additions.

If we keep shared_size, it may make sense to set it to NULL if we
don't know about it?  That's the case of the built-in fixed-sized
stats kinds.  We set the value for custom fixed-sized stats kinds.
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../../[email protected]/2-signature.asc)
  download

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

* Re: Add pg_stat_kind_info system view
@ 2026-06-04 16:59  Tristan Partin <[email protected]>
  parent: Michael Paquier <[email protected]>
  0 siblings, 1 reply; 67+ messages in thread

From: Tristan Partin @ 2026-06-04 16:59 UTC (permalink / raw)
  To: Michael Paquier <[email protected]>; +Cc: pgsql-hackers; Bertrand Drouvot <[email protected]>

On Mon Jun 1, 2026 at 5:41 AM UTC, Michael Paquier wrote:
> On Thu, May 28, 2026 at 05:11:42PM +0000, Tristan Partin wrote:
>> Can you share how someone might use this additional information?
>>
>> Not sure I understand why we would want to expose the existence of the 
>> callbacks to make assertions at the SQL level. I see that in 
>> pgstat_register_kind(), we have the following code:
>> 
>> We could extend these invariant checks to make sure that the callbacks 
>> are only set when fixed_amount is true for instance. I am very much open 
>> to having my mind changed.
>
> There is currently no internal mechanism to make sure that the
> built-in stats kinds have a consistent setup in terms of flags and
> callbacks set, so for developers we could immediately complain when
> generating patches that add new stats kinds.  For custom stats kinds,
> loaded libraries could have more cross-checks.

I think there is still some confusion on my end about this line of 
discussion.

> Perhaps it is not worth bothering at the end, and I'd be fine to keep
> the data published as minimal as you see fit.  Still, fixed_amount,
> write_to_file and accessed_across_databases feel like useful
> additions.

The additional columns are now added in v2. Note that I named 
write_to_file as written_to_file for the column name. I wonder if 
persisted would be a better name for the column and if persisted would 
be a better name for PgStat_KindInfo::write_to_file.

> If we keep shared_size, it may make sense to set it to NULL if we
> don't know about it?  That's the case of the built-in fixed-sized
> stats kinds.  We set the value for custom fixed-sized stats kinds.

I believe that I also captured this correctly in v2.

-- 
Tristan Partin
PostgreSQL Contributors Team
AWS (https://aws.amazon.com)






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

* Re: Add pg_stat_kind_info system view
@ 2026-06-08 00:16  Michael Paquier <[email protected]>
  parent: Tristan Partin <[email protected]>
  0 siblings, 1 reply; 67+ messages in thread

From: Michael Paquier @ 2026-06-08 00:16 UTC (permalink / raw)
  To: Tristan Partin <[email protected]>; +Cc: pgsql-hackers; Bertrand Drouvot <[email protected]>

On Thu, Jun 04, 2026 at 04:59:00PM +0000, Tristan Partin wrote:
> I believe that I also captured this correctly in v2.

No v2 of the patch has been attached.  :D
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../../[email protected]/2-signature.asc)
  download

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

* Re: Add pg_stat_kind_info system view
@ 2026-06-11 06:35  solai v <[email protected]>
  1 sibling, 0 replies; 67+ messages in thread

From: solai v @ 2026-06-11 06:35 UTC (permalink / raw)
  To: Tristan Partin <[email protected]>; +Cc: pgsql-hackers; Michael Paquier <[email protected]>; Bertrand Drouvot <[email protected]>

Hi all,

On Wed, Jun 10, 2026 at 3:34 PM Tristan Partin <[email protected]> wrote:
>
> Of course I forgot to attach the patch :D.
>
> --


I reviewed the v1 patch and had verified that both the view and the
function are created successfully and return identical results. The
builtin statistics kinds are exposed correctly, and the IDs and names
are unique without any duplicates. The count column behaves as
expected, returning NULL for statistics kinds that do not support
entry count tracking and 1 for fixed statistics kinds. While reviewing
the patch, I found it may be useful to expose a boolean column such as
track_entry_count in pg_stat_kind_info that would explicitly indicate
whether entry count tracking is enabled for a statistics kind and also
would help users understand why the count column is NULL for certain
statistics kinds. Exposing this internal property would make the view
more self-explanatory and improve its usefulness for debugging. Apart
from these suggestions, I did not find any issues with the current
implementation.
Looking forward to more feedback.


Regards,
Solai






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

* Re: Add pg_stat_kind_info system view
@ 2026-06-18 16:54  Tristan Partin <[email protected]>
  parent: Michael Paquier <[email protected]>
  0 siblings, 1 reply; 67+ messages in thread

From: Tristan Partin @ 2026-06-18 16:54 UTC (permalink / raw)
  To: Michael Paquier <[email protected]>; +Cc: pgsql-hackers; Bertrand Drouvot <[email protected]>

On Mon Jun 8, 2026 at 12:16 AM UTC, Michael Paquier wrote:
> On Thu, Jun 04, 2026 at 04:59:00PM +0000, Tristan Partin wrote:
>> I believe that I also captured this correctly in v2.
>
> No v2 of the patch has been attached.  :D

I am not a very smart person! :facepalm:

-- 
Tristan Partin
PostgreSQL Contributors Team
AWS (https://aws.amazon.com)


Attachments:

  [text/x-patch] v2-0001-Add-pg_stat_kind_info-view-and-pg_stat_get_kind_i.patch (15.5K, ../../[email protected]/2-v2-0001-Add-pg_stat_kind_info-view-and-pg_stat_get_kind_i.patch)
  download | inline diff:
From 62c2dac137d72bb76cbd01a48019c89d01535565 Mon Sep 17 00:00:00 2001
From: Tristan Partin <[email protected]>
Date: Thu, 30 Apr 2026 16:54:29 +0000
Subject: [PATCH v2] Add pg_stat_kind_info view and pg_stat_get_kind_info()

Expose metadata about loaded statistics kinds through the
pg_stat_kind_info view backed by the pg_stat_get_kind_info() function.
Each row describes one statistics kind:

id: numeric identifier of the kind
name: name of the kind of stats
count: number of entries counted
builtin: whether this is a builtin kind
fixed_amount: whether this kind tracks a fixed amount of data
accessed_across_databases: whether this kind can be accessed across
  databases
written_to_file: whether this kind is written out to the statistics file
shared_size: the size in bytes of a shared memory entry for this kind

With the view, extension authors can easily confirm that their custom
statistics kinds are loaded. We can also figure out how shared memory is
being used by statistics.

Signed-off-by: Tristan Partin <[email protected]>
---
 doc/src/sgml/monitoring.sgml                  | 141 ++++++++++++++++++
 src/backend/catalog/system_views.sql          |  12 ++
 src/backend/utils/adt/pgstatfuncs.c           |  59 ++++++++
 src/include/catalog/pg_proc.dat               |   8 +
 .../test_custom_stats/t/001_custom_stats.pl   |  13 +-
 src/test/regress/expected/rules.out           |   9 ++
 src/test/regress/expected/stats.out           |  22 +++
 src/test/regress/expected/sysviews.out        |   7 +
 src/test/regress/sql/stats.sql                |   8 +
 src/test/regress/sql/sysviews.sql             |   3 +
 10 files changed, 281 insertions(+), 1 deletion(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 08d5b82455..a3f33de96d 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -509,6 +509,15 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
      </entry>
      </row>
 
+     <row>
+      <entry><structname>pg_stat_kind_info</structname><indexterm><primary>pg_stat_kind_info</primary></indexterm></entry>
+      <entry>
+       One row for each loaded statistics kind, showing metadata about the kind.
+       See <link linkend="monitoring-pg-stat-kind-info-view">
+       <structname>pg_stat_kind_info</structname></link> for details.
+      </entry>
+     </row>
+
      <row>
       <entry><structname>pg_stat_lock</structname><indexterm><primary>pg_stat_lock</primary></indexterm></entry>
       <entry>
@@ -3303,6 +3312,138 @@ description | Waiting for a newly initialized WAL file to reach durable storage
  </sect2>
 
 
+ <sect2 id="monitoring-pg-stat-kind-info-view">
+  <title><structname>pg_stat_kind_info</structname></title>
+
+  <indexterm>
+   <primary>pg_stat_kind_info</primary>
+  </indexterm>
+
+  <para>
+   The <structname>pg_stat_kind_info</structname> view contains one row for each
+   loaded statistics kind, including both built-in and custom kinds.
+  </para>
+
+  <table id="pg-stat-kind-info-view" xreflabel="pg_stat_kind_info">
+   <title><structname>pg_stat_kind_info</structname> View</title>
+   <tgroup cols="1">
+    <thead>
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        Column Type
+       </para>
+       <para>
+        Description
+       </para>
+      </entry>
+     </row>
+    </thead>
+    <tbody>
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>id</structfield> <type>integer</type>
+       </para>
+       <para>
+        Numeric identifier of the statistics kind.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>name</structfield> <type>text</type>
+       </para>
+       <para>
+        Name of the statistics kind.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>count</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Number of tracked entries for this kind. For fixed-amount kinds, this is
+        always 1. For variable-numbered kinds, this is the number of objects
+        currently tracked. <literal>NULL</literal> if the kind does not track
+        entry counts.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>builtin</structfield> <type>boolean</type>
+       </para>
+       <para>
+        True if this is a built-in statistics kind, false if it was registered
+        by an extension.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>fixed_amount</structfield> <type>boolean</type>
+       </para>
+       <para>
+        True if this kind tracks a fixed amount of data (a single, statically
+        allocated entry), false if it tracks a variable number of entries
+        keyed by object identifier.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>accessed_across_databases</structfield> <type>boolean</type>
+       </para>
+       <para>
+        True if entries of this kind are accessed across databases (cluster-wide
+        statistics), false if they are scoped to a single database.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>written_to_file</structfield> <type>boolean</type>
+       </para>
+       <para>
+        True if entries of this kind are persisted to the statistics file at
+        shutdown and reloaded on startup, false if they are kept only in
+        shared memory.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>shared_size</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Size in bytes of a shared memory entry for this statistics kind.
+        <literal>NULL</literal> for built-in fixed-amount kinds, whose
+        single entry lives in a statically-allocated slot rather than a
+        sized shared memory entry.
+       </para>
+      </entry>
+     </row>
+    </tbody>
+   </tgroup>
+  </table>
+ </sect2>
+
  <sect2 id="monitoring-pg-stat-lock-view">
   <title><structname>pg_stat_lock</structname></title>
 
diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql
index 73a1c1c467..5ce455f7ec 100644
--- a/src/backend/catalog/system_views.sql
+++ b/src/backend/catalog/system_views.sql
@@ -1282,6 +1282,18 @@ SELECT
        b.stats_reset
 FROM pg_stat_get_io() b;
 
+CREATE VIEW pg_stat_kind_info AS
+    SELECT
+        k.id,
+        k.name,
+        k.count,
+        k.builtin,
+        k.fixed_amount,
+        k.accessed_across_databases,
+        k.written_to_file,
+        k.shared_size
+    FROM pg_stat_get_kind_info() k;
+
 CREATE VIEW pg_stat_wal AS
     SELECT
         w.wal_records,
diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c
index 6f9c9c72de..acb8c4883e 100644
--- a/src/backend/utils/adt/pgstatfuncs.c
+++ b/src/backend/utils/adt/pgstatfuncs.c
@@ -30,6 +30,8 @@
 #include "storage/procarray.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
+#include "utils/pgstat_internal.h"
+#include "utils/pgstat_kind.h"
 #include "utils/timestamp.h"
 #include "utils/tuplestore.h"
 #include "utils/wait_event.h"
@@ -1638,6 +1640,63 @@ pg_stat_get_backend_io(PG_FUNCTION_ARGS)
 	return (Datum) 0;
 }
 
+Datum
+pg_stat_get_kind_info(PG_FUNCTION_ARGS)
+{
+#define PG_STAT_KIND_INFO_COLS	8
+	ReturnSetInfo *rsinfo;
+
+	InitMaterializedSRF(fcinfo, 0);
+	rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
+
+	for (int kind = PGSTAT_KIND_MIN; kind <= PGSTAT_KIND_MAX; kind++)
+	{
+		Datum		values[PG_STAT_KIND_INFO_COLS] = {0};
+		bool		nulls[PG_STAT_KIND_INFO_COLS] = {0};
+		const PgStat_KindInfo *info;
+
+		info = pgstat_get_kind_info(kind);
+		if (info == NULL)
+			continue;
+
+		values[0] = Int32GetDatum(kind);
+		values[1] = CStringGetTextDatum(info->name);
+
+		/* For fixed-amount kinds, count is always 1. The entry is stored in
+		 * PgStat_ShmemControl. If it is not a fixed-amount, then report the
+		 * count of entries if tracked, or NULL if not tracked.
+		 */
+		if (info->fixed_amount)
+			values[2] = Int64GetDatum(1);
+		else if (info->track_entry_count)
+			values[2] = Int64GetDatum(pgstat_get_entry_count(kind));
+		else
+			nulls[2] = true;
+
+		values[3] = BoolGetDatum(pgstat_is_kind_builtin(kind));
+		values[4] = BoolGetDatum(info->fixed_amount);
+		values[5] = BoolGetDatum(info->accessed_across_databases);
+		values[6] = BoolGetDatum(info->write_to_file);
+
+		/*
+		 * Built-in fixed-amount kinds store their single entry in
+		 * PgStat_ShmemControl, so shared_size is unused and left zero in their
+		 * PgStat_KindInfo. Reporting it would be misleading, so report NULL
+		 * instead. Custom fixed-amount kinds declare shared_size to size their
+		 * slot in custom_data[], so it is meaningful and reported as-is.
+		 */
+		if (info->fixed_amount && pgstat_is_kind_builtin(kind))
+			nulls[7] = true;
+		else
+			values[7] = Int64GetDatum(info->shared_size);
+
+		tuplestore_putvalues(rsinfo->setResult, rsinfo->setDesc, values, nulls);
+	}
+
+	return (Datum) 0;
+#undef PG_STAT_KIND_INFO_COLS
+}
+
 /*
  * pg_stat_wal_build_tuple
  *
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index be157a5fbe..a9ac9304b9 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -6078,6 +6078,14 @@
   proargnames => '{backend_pid,backend_type,object,context,reads,read_bytes,read_time,writes,write_bytes,write_time,writebacks,writeback_time,extends,extend_bytes,extend_time,hits,evictions,reuses,fsyncs,fsync_time,stats_reset}',
   prosrc => 'pg_stat_get_backend_io' },
 
+{ oid => '8683', descr => 'statistics: information about loaded statistics kinds',
+  proname => 'pg_stat_get_kind_info', prorows => '20', proretset => 't',
+  provolatile => 'v', proparallel => 'r', prorettype => 'record',
+  proargtypes => '', proallargtypes => '{int4,text,int8,bool,bool,bool,bool,int8}',
+  proargmodes => '{o,o,o,o,o,o,o,o}',
+  proargnames => '{id,name,count,builtin,fixed_amount,accessed_across_databases,written_to_file,shared_size}',
+  prosrc => 'pg_stat_get_kind_info' },
+
 { oid => '1136', descr => 'statistics: information about WAL activity',
   proname => 'pg_stat_get_wal', proisstrict => 'f', provolatile => 's',
   proparallel => 'r', prorettype => 'record', proargtypes => '',
diff --git a/src/test/modules/test_custom_stats/t/001_custom_stats.pl b/src/test/modules/test_custom_stats/t/001_custom_stats.pl
index 9e6a7a3857..1b11d81687 100644
--- a/src/test/modules/test_custom_stats/t/001_custom_stats.pl
+++ b/src/test/modules/test_custom_stats/t/001_custom_stats.pl
@@ -27,6 +27,17 @@
 $node->safe_psql('postgres', q(CREATE EXTENSION test_custom_var_stats));
 $node->safe_psql('postgres', q(CREATE EXTENSION test_custom_fixed_stats));
 
+# Verify custom stats kinds appear in pg_stat_kind_info.
+my $result = $node->safe_psql('postgres',
+	q(SELECT id, name, builtin, fixed_amount, accessed_across_databases,
+	         written_to_file, shared_size > 0
+	    FROM pg_stat_kind_info
+	    WHERE name LIKE 'test_custom%' ORDER BY id));
+is($result,
+	"25|test_custom_var_stats|f|f|t|t|t\n" .
+	"26|test_custom_fixed_stats|f|t|f|t|t",
+	"custom stats kinds visible in pg_stat_kind_info");
+
 # Create entries for variable-sized stats.
 $node->safe_psql('postgres',
 	q(select test_custom_stats_var_create('entry1', 'Test entry 1')));
@@ -63,7 +74,7 @@
 $node->safe_psql('postgres', q(select test_custom_stats_fixed_update()));
 
 # Test data reports.
-my $result = $node->safe_psql('postgres',
+$result = $node->safe_psql('postgres',
 	q(select * from test_custom_stats_var_report('entry1')));
 is( $result,
 	"entry1|2|Test entry 1",
diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out
index a65a5bf0c4..4ee3191f9d 100644
--- a/src/test/regress/expected/rules.out
+++ b/src/test/regress/expected/rules.out
@@ -1967,6 +1967,15 @@ pg_stat_io| SELECT backend_type,
     fsync_time,
     stats_reset
    FROM pg_stat_get_io() b(backend_type, object, context, reads, read_bytes, read_time, writes, write_bytes, write_time, writebacks, writeback_time, extends, extend_bytes, extend_time, hits, evictions, reuses, fsyncs, fsync_time, stats_reset);
+pg_stat_kind_info| SELECT id,
+    name,
+    count,
+    builtin,
+    fixed_amount,
+    accessed_across_databases,
+    written_to_file,
+    shared_size
+   FROM pg_stat_get_kind_info() k(id, name, count, builtin, fixed_amount, accessed_across_databases, written_to_file, shared_size);
 pg_stat_lock| SELECT locktype,
     waits,
     wait_time,
diff --git a/src/test/regress/expected/stats.out b/src/test/regress/expected/stats.out
index bbb1db3c43..33197a62a5 100644
--- a/src/test/regress/expected/stats.out
+++ b/src/test/regress/expected/stats.out
@@ -113,6 +113,28 @@ walwriter|wal|init
 walwriter|wal|normal
 (95 rows)
 \a
+-- List of loaded statistics kinds.
+\a
+SELECT name, id, fixed_amount, accessed_across_databases, written_to_file
+  FROM pg_stat_kind_info
+  WHERE builtin
+  ORDER BY name COLLATE "C";
+name|id|fixed_amount|accessed_across_databases|written_to_file
+archiver|7|t|f|t
+backend|6|f|t|f
+bgwriter|8|t|f|t
+checkpointer|9|t|f|t
+database|1|f|t|t
+function|3|f|f|t
+io|10|t|f|t
+lock|11|t|f|t
+relation|2|f|f|t
+replslot|4|f|t|t
+slru|12|t|f|t
+subscription|5|f|t|t
+wal|13|t|f|t
+(13 rows)
+\a
 -- ensure that both seqscan and indexscan plans are allowed
 SET enable_seqscan TO on;
 SET enable_indexscan TO on;
diff --git a/src/test/regress/expected/sysviews.out b/src/test/regress/expected/sysviews.out
index 132b56a586..ac9e033c2a 100644
--- a/src/test/regress/expected/sysviews.out
+++ b/src/test/regress/expected/sysviews.out
@@ -129,6 +129,13 @@ select count(*) > 0 as ok from pg_stat_slru;
  t
 (1 row)
 
+-- There should be at least one statistics kind loaded
+select count(*) > 0 as ok from pg_stat_kind_info;
+ ok 
+----
+ t
+(1 row)
+
 -- There must be only one record
 select count(*) = 1 as ok from pg_stat_wal;
  ok 
diff --git a/src/test/regress/sql/stats.sql b/src/test/regress/sql/stats.sql
index 610fd21fae..f79cbbd9d8 100644
--- a/src/test/regress/sql/stats.sql
+++ b/src/test/regress/sql/stats.sql
@@ -14,6 +14,14 @@ SELECT backend_type, object, context FROM pg_stat_io
   ORDER BY backend_type COLLATE "C", object COLLATE "C", context COLLATE "C";
 \a
 
+-- List of loaded statistics kinds.
+\a
+SELECT name, id, fixed_amount, accessed_across_databases, written_to_file
+  FROM pg_stat_kind_info
+  WHERE builtin
+  ORDER BY name COLLATE "C";
+\a
+
 -- ensure that both seqscan and indexscan plans are allowed
 SET enable_seqscan TO on;
 SET enable_indexscan TO on;
diff --git a/src/test/regress/sql/sysviews.sql b/src/test/regress/sql/sysviews.sql
index 507e400ad4..193bf84dad 100644
--- a/src/test/regress/sql/sysviews.sql
+++ b/src/test/regress/sql/sysviews.sql
@@ -70,6 +70,9 @@ select count(*) >= 0 as ok from pg_prepared_xacts;
 -- There will surely be at least one SLRU cache
 select count(*) > 0 as ok from pg_stat_slru;
 
+-- There should be at least one statistics kind loaded
+select count(*) > 0 as ok from pg_stat_kind_info;
+
 -- There must be only one record
 select count(*) = 1 as ok from pg_stat_wal;
 
-- 
Tristan Partin
https://tristan.partin.io



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

* Re: Add pg_stat_kind_info system view
@ 2026-06-24 04:12  Michael Paquier <[email protected]>
  parent: Tristan Partin <[email protected]>
  0 siblings, 1 reply; 67+ messages in thread

From: Michael Paquier @ 2026-06-24 04:12 UTC (permalink / raw)
  To: Tristan Partin <[email protected]>; +Cc: pgsql-hackers; Bertrand Drouvot <[email protected]>

On Thu, Jun 18, 2026 at 04:54:36PM +0000, Tristan Partin wrote:
> On Mon Jun 8, 2026 at 12:16 AM UTC, Michael Paquier wrote:
>> On Thu, Jun 04, 2026 at 04:59:00PM +0000, Tristan Partin wrote:
>>> I believe that I also captured this correctly in v2.
>>
>> No v2 of the patch has been attached.  :D
> 
> I am not a very smart person! :facepalm:

Thanks for the patch.

A small comment that I have is related to the use of the unaligned
output of in stats.sql, where I doubt that we'll have a stats kind
named with more characters than the existing ones.  And there are a
bunch of bools, which would be easier to read if aligned.

"written_to_file" as attribute name of the SQL function is
inconsistent.  "write_to_file" would be.

The rest looks pretty much OK, seen from here.
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../../[email protected]/2-signature.asc)
  download

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

* Re: Add pg_stat_kind_info system view
@ 2026-06-24 05:31  Bertrand Drouvot <[email protected]>
  parent: Michael Paquier <[email protected]>
  0 siblings, 1 reply; 67+ messages in thread

From: Bertrand Drouvot @ 2026-06-24 05:31 UTC (permalink / raw)
  To: Michael Paquier <[email protected]>; +Cc: Tristan Partin <[email protected]>; pgsql-hackers

Hi,

On Wed, Jun 24, 2026 at 01:12:09PM +0900, Michael Paquier wrote:
> On Thu, Jun 18, 2026 at 04:54:36PM +0000, Tristan Partin wrote:
> > On Mon Jun 8, 2026 at 12:16 AM UTC, Michael Paquier wrote:
> >> On Thu, Jun 04, 2026 at 04:59:00PM +0000, Tristan Partin wrote:
> >>> I believe that I also captured this correctly in v2.
> >>
> >> No v2 of the patch has been attached.  :D

Thanks for the patch, that looks like an useful addition to me.

A few comments:

=== 1

+++ b/src/backend/utils/adt/pgstatfuncs.c
@@ -30,6 +30,8 @@
 #include "storage/procarray.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
+#include "utils/pgstat_internal.h"

But header in pgstat_internal.h mentions:

"
 * Definitions for the PostgreSQL cumulative statistics system that should
 * only be needed by files implementing statistics support (rather than ones
 * reporting / querying stats).

"

So it looks like that we are breaking this convention here. Maybe add helper
function(s)?

=== 2

+  /* For fixed-amount kinds, count is always 1. The entry is stored in
+   * PgStat_ShmemControl. If it is not a fixed-amount, then report the
+   * count of entries if tracked, or NULL if not tracked.
+   */

comment style is not right.

=== 3

+  /* For fixed-amount kinds, count is always 1.

Why not report NULL for fixed-amount kinds too? The track_entry_count field is
documented as being for variable-numbered stats only, so the count would only be
reported for custom variable-numbered kinds that set it to true.

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com





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

* Re: Add pg_stat_kind_info system view
@ 2026-06-30 06:42  Michael Paquier <[email protected]>
  parent: Bertrand Drouvot <[email protected]>
  0 siblings, 1 reply; 67+ messages in thread

From: Michael Paquier @ 2026-06-30 06:42 UTC (permalink / raw)
  To: Bertrand Drouvot <[email protected]>; +Cc: Tristan Partin <[email protected]>; pgsql-hackers

On Wed, Jun 24, 2026 at 05:31:12AM +0000, Bertrand Drouvot wrote:
> But header in pgstat_internal.h mentions:
> 
> "
>  * Definitions for the PostgreSQL cumulative statistics system that should
>  * only be needed by files implementing statistics support (rather than ones
>  * reporting / querying stats).
> 
> "
> 
> So it looks like that we are breaking this convention here. Maybe add helper
> function(s)?

Yeah.  Pulling pgstat_internal.h in pgstatfuncs.c is not great.  The
code acts as a barrier as the internal part and the fields data
retrieved by the functions.  A couple of alternatives I can think of:
- Put this new function in a new file under activity, named blankly
pgstat_kind.c.
- Move the necessary stuff out of pgstat_internal.h into a new header,
or just pgstat_kind.h with a !FRONTEND block.
- Use a new wrapper function that copies the data we need into an
intermediate structure.  This is just a new pgstat_get_kind_info().

Among these two, putting pg_stat_get_kind_info() into a new file feels
much better than splitting the contents of pgstat_internal.h, which is
kind of the central in-core shmem-side facility.  Using a wrapper as
of option 3 looks weird knowing the existence of the kind_info()
function.

Bertrand?  Tristan?
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../../[email protected]/2-signature.asc)
  download

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

* Re: Add pg_stat_kind_info system view
@ 2026-06-30 07:59  Bertrand Drouvot <[email protected]>
  parent: Michael Paquier <[email protected]>
  0 siblings, 1 reply; 67+ messages in thread

From: Bertrand Drouvot @ 2026-06-30 07:59 UTC (permalink / raw)
  To: Michael Paquier <[email protected]>; +Cc: Tristan Partin <[email protected]>; pgsql-hackers

Hi,

On Tue, Jun 30, 2026 at 03:42:40PM +0900, Michael Paquier wrote:
> On Wed, Jun 24, 2026 at 05:31:12AM +0000, Bertrand Drouvot wrote:
> > But header in pgstat_internal.h mentions:
> > 
> > "
> >  * Definitions for the PostgreSQL cumulative statistics system that should
> >  * only be needed by files implementing statistics support (rather than ones
> >  * reporting / querying stats).
> > 
> > "
> > 
> > So it looks like that we are breaking this convention here. Maybe add helper
> > function(s)?
> 
> Yeah.  Pulling pgstat_internal.h in pgstatfuncs.c is not great.  The
> code acts as a barrier as the internal part and the fields data
> retrieved by the functions.  A couple of alternatives I can think of:
> - Put this new function in a new file under activity, named blankly
> pgstat_kind.c.
> - Move the necessary stuff out of pgstat_internal.h into a new header,
> or just pgstat_kind.h with a !FRONTEND block.
> - Use a new wrapper function that copies the data we need into an
> intermediate structure.  This is just a new pgstat_get_kind_info().
> 
> Among these two, putting pg_stat_get_kind_info() into a new file feels
> much better than splitting the contents of pgstat_internal.h, which is
> kind of the central in-core shmem-side facility.

I do agree. That said, creating a new file only for one function looks a bit
weird (but I can not think of a better option though).

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com





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

* Re: Add pg_stat_kind_info system view
@ 2026-06-30 08:02  Michael Paquier <[email protected]>
  parent: Bertrand Drouvot <[email protected]>
  0 siblings, 1 reply; 67+ messages in thread

From: Michael Paquier @ 2026-06-30 08:02 UTC (permalink / raw)
  To: Bertrand Drouvot <[email protected]>; +Cc: Tristan Partin <[email protected]>; pgsql-hackers

On Tue, Jun 30, 2026 at 07:59:04AM +0000, Bertrand Drouvot wrote:
> I do agree. That said, creating a new file only for one function looks a bit
> weird (but I can not think of a better option though).

FWIW, I've done that in the past, when it was necessary.
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../../[email protected]/2-signature.asc)
  download

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

* Re: Add pg_stat_kind_info system view
@ 2026-06-30 22:36  Sami Imseih <[email protected]>
  parent: Michael Paquier <[email protected]>
  0 siblings, 1 reply; 67+ messages in thread

From: Sami Imseih @ 2026-06-30 22:36 UTC (permalink / raw)
  To: Michael Paquier <[email protected]>; +Cc: Bertrand Drouvot <[email protected]>; Tristan Partin <[email protected]>; pgsql-hackers

Hi,

Thanks for working on this. I like this overall, but have some comments.

1/

+       One row for each loaded statistics kind, showing metadata
about the kind.

The description says "showing metadata about the kind" but
the count  column returns live runtime data (via pgstat_get_entry_count()),
not just metadata. The description should acknowledge both.

2/

+        <structfield>shared_size</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Size in bytes of a shared memory entry for this statistics kind.
+        <literal>NULL</literal> for built-in fixed-amount kinds, whose
+        single entry lives in a statically-allocated slot rather than a
+        sized shared memory entry.

I think we should just use info->shared_data_len for both fixed and
variable-length kinds. This shows the entry_size which is what an
extension developer will care about. Even info->shared_size for
variable-length kinds does not include the per-entry overhead,
so info->shared_data_len will be useful to understand if the size
of your entry changed after an upgrade, etc. Also, we should
rename it to "entry_size" instead of "shared_size"

3/

+        <structfield>count</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Number of tracked entries for this kind. For fixed-amount
kinds, this is
+        always 1. For variable-numbered kinds, this is the number of objects
+        currently tracked. <literal>NULL</literal> if the kind does not track
+        entry counts.
+       </para>
+      </entry>

I think this should be 0 for all kinds by default. Only ever > 0 for
variable-numbered
kinds with entry tracking enabled. No NULLs. The fields should be called
"entry_count" instead of "count". We should update the documentation to
reflect that as well. That seems easier to query than having mixed NULLs and
numbers.


Sami Imseih
Amazon Web Services (AWS)






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

* Re: Add pg_stat_kind_info system view
@ 2026-07-01 01:35  Michael Paquier <[email protected]>
  parent: Sami Imseih <[email protected]>
  0 siblings, 1 reply; 67+ messages in thread

From: Michael Paquier @ 2026-07-01 01:35 UTC (permalink / raw)
  To: Sami Imseih <[email protected]>; +Cc: Bertrand Drouvot <[email protected]>; Tristan Partin <[email protected]>; pgsql-hackers

On Tue, Jun 30, 2026 at 05:36:57PM -0500, Sami Imseih wrote:
> +        <structfield>count</structfield> <type>bigint</type>
> +       </para>
> +       <para>
> +        Number of tracked entries for this kind. For fixed-amount
> kinds, this is
> +        always 1. For variable-numbered kinds, this is the number of objects
> +        currently tracked. <literal>NULL</literal> if the kind does not track
> +        entry counts.
> +       </para>
> +      </entry>
> 
> I think this should be 0 for all kinds by default. Only ever > 0 for
> variable-numbered
> kinds with entry tracking enabled. No NULLs. The fields should be called
> "entry_count" instead of "count". We should update the documentation to
> reflect that as well. That seems easier to query than having mixed NULLs and
> numbers.

IMO, in this case, NULL should be a synonym of "I don't know", which
is what entry_count set to false means.  0 means "I know, there is no
data".  I'd be OK with dropping the part about fixed-sized stats where
we enforce 1, and use NULL instead, though.
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../../[email protected]/2-signature.asc)
  download

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

* Re: Add pg_stat_kind_info system view
@ 2026-07-01 03:39  Bertrand Drouvot <[email protected]>
  parent: Michael Paquier <[email protected]>
  0 siblings, 1 reply; 67+ messages in thread

From: Bertrand Drouvot @ 2026-07-01 03:39 UTC (permalink / raw)
  To: Michael Paquier <[email protected]>; +Cc: Sami Imseih <[email protected]>; Tristan Partin <[email protected]>; pgsql-hackers

Hi,

On Wed, Jul 01, 2026 at 10:35:33AM +0900, Michael Paquier wrote:
> On Tue, Jun 30, 2026 at 05:36:57PM -0500, Sami Imseih wrote:
> > +        <structfield>count</structfield> <type>bigint</type>
> > +       </para>
> > +       <para>
> > +        Number of tracked entries for this kind. For fixed-amount
> > kinds, this is
> > +        always 1. For variable-numbered kinds, this is the number of objects
> > +        currently tracked. <literal>NULL</literal> if the kind does not track
> > +        entry counts.
> > +       </para>
> > +      </entry>
> > 
> > I think this should be 0 for all kinds by default. Only ever > 0 for
> > variable-numbered
> > kinds with entry tracking enabled. No NULLs. The fields should be called
> > "entry_count" instead of "count". We should update the documentation to
> > reflect that as well. That seems easier to query than having mixed NULLs and
> > numbers.
> 
> IMO, in this case, NULL should be a synonym of "I don't know", which
> is what entry_count set to false means.  0 means "I know, there is no
> data".  I'd be OK with dropping the part about fixed-sized stats where
> we enforce 1, and use NULL instead, though.

+1, that's also my opinion [1].

[1]: https://postgr.es/m/ajtroNXfBS/ldtNZ%40bdtpg

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com





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

* Re: Add pg_stat_kind_info system view
@ 2026-07-01 04:17  Sami Imseih <[email protected]>
  parent: Bertrand Drouvot <[email protected]>
  0 siblings, 1 reply; 67+ messages in thread

From: Sami Imseih @ 2026-07-01 04:17 UTC (permalink / raw)
  To: Bertrand Drouvot <[email protected]>; +Cc: Michael Paquier <[email protected]>; Tristan Partin <[email protected]>; pgsql-hackers

> > > I think this should be 0 for all kinds by default. Only ever > 0 for
> > > variable-numbered
> > > kinds with entry tracking enabled. No NULLs. The fields should be called
> > > "entry_count" instead of "count". We should update the documentation to
> > > reflect that as well. That seems easier to query than having mixed NULLs and
> > > numbers.
> >
> > IMO, in this case, NULL should be a synonym of "I don't know", which
> > is what entry_count set to false means.  0 means "I know, there is no
> > data".  I'd be OK with dropping the part about fixed-sized stats where
> > we enforce 1, and use NULL instead, though.
>
> +1, that's also my opinion [1].
>
> [1]: https://postgr.es/m/ajtroNXfBS/ldtNZ%40bdtpg

I'm ok with that if others feel this is better.

--
Sami





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

* Re: Add pg_stat_kind_info system view
@ 2026-07-01 07:07  Michael Paquier <[email protected]>
  parent: Sami Imseih <[email protected]>
  0 siblings, 1 reply; 67+ messages in thread

From: Michael Paquier @ 2026-07-01 07:07 UTC (permalink / raw)
  To: Sami Imseih <[email protected]>; +Cc: Bertrand Drouvot <[email protected]>; Tristan Partin <[email protected]>; pgsql-hackers

On Tue, Jun 30, 2026 at 11:17:29PM -0500, Sami Imseih wrote:
>>> IMO, in this case, NULL should be a synonym of "I don't know", which
>>> is what entry_count set to false means.  0 means "I know, there is no
>>> data".  I'd be OK with dropping the part about fixed-sized stats where
>>> we enforce 1, and use NULL instead, though.
>>
>> +1, that's also my opinion [1].
>
> I'm ok with that if others feel this is better.

Okay, thanks.  Let's do so then.  Let's also invent a new
pgstat_kind.c in activity/.

I have been chewing a bit on the comments from Sami, leading to the
following result:
- Switched shared_size to entry_size, for consistency with
entry_count, but I don't agree about the use of shared_data_len.
shared_size is more adapted to me because it has the entry overhead
and the shmem entry header.  That's more precise and one does not need
to guess the header size.
- Moved entry_count after entry_size in the list of attributes.
- written_to_file -> write_to_file, same as pgstat_internal.h.
- Moved the new function to a pgstat_kind.c.
- Some extra changes and tweaks to the comments, the docs, some code.

The attached should do all that, hopefully.  Any thoughts?
--
Michael

From 32b0910efdeeefb75ab3aa74100f446302a68a2e Mon Sep 17 00:00:00 2001
From: Michael Paquier <[email protected]>
Date: Wed, 1 Jul 2026 15:56:11 +0900
Subject: [PATCH v3] Add pg_stat_kind_info view

Blah..
---
 src/include/catalog/pg_proc.dat               |  10 ++
 src/backend/catalog/system_views.sql          |  12 ++
 src/backend/utils/activity/Makefile           |   1 +
 src/backend/utils/activity/meson.build        |   1 +
 src/backend/utils/activity/pgstat_kind.c      |  85 +++++++++++
 .../test_custom_stats/t/001_custom_stats.pl   |  14 +-
 src/test/regress/expected/rules.out           |   9 ++
 src/test/regress/expected/stats.out           |  23 +++
 src/test/regress/expected/sysviews.out        |   7 +
 src/test/regress/sql/stats.sql                |   7 +
 src/test/regress/sql/sysviews.sql             |   3 +
 doc/src/sgml/monitoring.sgml                  | 142 ++++++++++++++++++
 12 files changed, 313 insertions(+), 1 deletion(-)
 create mode 100644 src/backend/utils/activity/pgstat_kind.c

diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 73bb7fbb4304..9571f033aa85 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -6078,6 +6078,16 @@
   proargnames => '{backend_pid,backend_type,object,context,reads,read_bytes,read_time,writes,write_bytes,write_time,writebacks,writeback_time,extends,extend_bytes,extend_time,hits,evictions,reuses,fsyncs,fsync_time,stats_reset}',
   prosrc => 'pg_stat_get_backend_io' },
 
+{ oid => '8683',
+  descr => 'statistics: information about loaded statistics kinds',
+  proname => 'pg_stat_get_kind_info', prorows => '20', proretset => 't',
+  provolatile => 'v', proparallel => 'r', prorettype => 'record',
+  proargtypes => '',
+  proallargtypes => '{int4,text,bool,bool,bool,bool,int8,int8}',
+  proargmodes => '{o,o,o,o,o,o,o,o}',
+  proargnames => '{id,name,builtin,fixed_amount,accessed_across_databases,write_to_file,entry_size,entry_count}',
+  prosrc => 'pg_stat_get_kind_info' },
+
 { oid => '1136', descr => 'statistics: information about WAL activity',
   proname => 'pg_stat_get_wal', proisstrict => 'f', provolatile => 's',
   proparallel => 'r', prorettype => 'record', proargtypes => '',
diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql
index 8f129baec906..6a9d94d78f34 100644
--- a/src/backend/catalog/system_views.sql
+++ b/src/backend/catalog/system_views.sql
@@ -1282,6 +1282,18 @@ SELECT
        b.stats_reset
 FROM pg_stat_get_io() b;
 
+CREATE VIEW pg_stat_kind_info AS
+    SELECT
+        k.id,
+        k.name,
+        k.builtin,
+        k.fixed_amount,
+        k.accessed_across_databases,
+        k.write_to_file,
+        k.entry_size,
+        k.entry_count
+    FROM pg_stat_get_kind_info() k;
+
 CREATE VIEW pg_stat_wal AS
     SELECT
         w.wal_records,
diff --git a/src/backend/utils/activity/Makefile b/src/backend/utils/activity/Makefile
index ca3ef89bf599..5fed953c28a7 100644
--- a/src/backend/utils/activity/Makefile
+++ b/src/backend/utils/activity/Makefile
@@ -26,6 +26,7 @@ OBJS = \
 	pgstat_database.o \
 	pgstat_function.o \
 	pgstat_io.o \
+	pgstat_kind.o \
 	pgstat_lock.o \
 	pgstat_relation.o \
 	pgstat_replslot.o \
diff --git a/src/backend/utils/activity/meson.build b/src/backend/utils/activity/meson.build
index 1aa7ece52908..470b5dac402b 100644
--- a/src/backend/utils/activity/meson.build
+++ b/src/backend/utils/activity/meson.build
@@ -11,6 +11,7 @@ backend_sources += files(
   'pgstat_database.c',
   'pgstat_function.c',
   'pgstat_io.c',
+  'pgstat_kind.c',
   'pgstat_lock.c',
   'pgstat_relation.c',
   'pgstat_replslot.c',
diff --git a/src/backend/utils/activity/pgstat_kind.c b/src/backend/utils/activity/pgstat_kind.c
new file mode 100644
index 000000000000..bc43553170b5
--- /dev/null
+++ b/src/backend/utils/activity/pgstat_kind.c
@@ -0,0 +1,85 @@
+/*-------------------------------------------------------------------------
+ *
+ * pgstat_kind.c
+ *	  Functions related to statistics kinds.
+ *
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ *
+ * IDENTIFICATION
+ *	  src/backend/utils/activity/pgstat_kind.c
+ *
+ *-------------------------------------------------------------------------
+ */
+#include "postgres.h"
+
+#include "fmgr.h"
+#include "funcapi.h"
+#include "utils/builtins.h"
+#include "utils/fmgrprotos.h"
+#include "utils/pgstat_internal.h"
+#include "utils/pgstat_kind.h"
+#include "utils/tuplestore.h"
+
+
+/*
+ * pg_stat_get_kind_info
+ *
+ * Get information about the statistics kinds loaded into the system.
+ */
+Datum
+pg_stat_get_kind_info(PG_FUNCTION_ARGS)
+{
+#define PG_STAT_KIND_INFO_COLS	8
+	ReturnSetInfo *rsinfo;
+
+	InitMaterializedSRF(fcinfo, 0);
+	rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
+
+	for (int kind = PGSTAT_KIND_MIN; kind <= PGSTAT_KIND_MAX; kind++)
+	{
+		Datum		values[PG_STAT_KIND_INFO_COLS] = {0};
+		bool		nulls[PG_STAT_KIND_INFO_COLS] = {0};
+		const PgStat_KindInfo *info;
+
+		info = pgstat_get_kind_info(kind);
+		if (info == NULL)
+			continue;
+
+		values[0] = Int32GetDatum(kind);
+		values[1] = CStringGetTextDatum(info->name);
+
+		values[2] = BoolGetDatum(pgstat_is_kind_builtin(kind));
+		values[3] = BoolGetDatum(info->fixed_amount);
+		values[4] = BoolGetDatum(info->accessed_across_databases);
+		values[5] = BoolGetDatum(info->write_to_file);
+
+		/*
+		 * Built-in fixed-amount kinds store their single entry in
+		 * PgStat_ShmemControl, so shared_size is unused and left zero in
+		 * their PgStat_KindInfo.  Reporting it would be misleading, so report
+		 * NULL instead.  Custom fixed-amount kinds declare shared_size to
+		 * size their slot in custom_data[].
+		 */
+		if (info->fixed_amount && pgstat_is_kind_builtin(kind))
+			nulls[6] = true;
+		else
+			values[6] = Int64GetDatum(info->shared_size);
+
+		/*
+		 * When track_entry_count is disabled, use NULL.  Fixed-sized stats
+		 * kinds report NULL here.
+		 */
+		if (info->track_entry_count)
+			values[7] = Int64GetDatum(pgstat_get_entry_count(kind));
+		else
+			nulls[7] = true;
+
+
+		tuplestore_putvalues(rsinfo->setResult, rsinfo->setDesc, values, nulls);
+	}
+
+	return (Datum) 0;
+#undef PG_STAT_KIND_INFO_COLS
+}
diff --git a/src/test/modules/test_custom_stats/t/001_custom_stats.pl b/src/test/modules/test_custom_stats/t/001_custom_stats.pl
index 9e6a7a385775..f1774ba6f925 100644
--- a/src/test/modules/test_custom_stats/t/001_custom_stats.pl
+++ b/src/test/modules/test_custom_stats/t/001_custom_stats.pl
@@ -27,6 +27,18 @@ $node->start;
 $node->safe_psql('postgres', q(CREATE EXTENSION test_custom_var_stats));
 $node->safe_psql('postgres', q(CREATE EXTENSION test_custom_fixed_stats));
 
+# Verify custom stats kinds appear in pg_stat_kind_info.
+my $result = $node->safe_psql(
+	'postgres',
+	q(SELECT id, name, builtin, fixed_amount, accessed_across_databases,
+	         write_to_file, entry_size > 0
+	    FROM pg_stat_kind_info
+	    WHERE name LIKE 'test_custom%' ORDER BY id));
+is( $result,
+	qq{25|test_custom_var_stats|f|f|t|t|t
+26|test_custom_fixed_stats|f|t|f|t|t},
+	"custom stats kinds visible in pg_stat_kind_info");
+
 # Create entries for variable-sized stats.
 $node->safe_psql('postgres',
 	q(select test_custom_stats_var_create('entry1', 'Test entry 1')));
@@ -63,7 +75,7 @@ $node->safe_psql('postgres', q(select test_custom_stats_fixed_update()));
 $node->safe_psql('postgres', q(select test_custom_stats_fixed_update()));
 
 # Test data reports.
-my $result = $node->safe_psql('postgres',
+$result = $node->safe_psql('postgres',
 	q(select * from test_custom_stats_var_report('entry1')));
 is( $result,
 	"entry1|2|Test entry 1",
diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out
index a65a5bf0c4fb..4ed7b31528f9 100644
--- a/src/test/regress/expected/rules.out
+++ b/src/test/regress/expected/rules.out
@@ -1967,6 +1967,15 @@ pg_stat_io| SELECT backend_type,
     fsync_time,
     stats_reset
    FROM pg_stat_get_io() b(backend_type, object, context, reads, read_bytes, read_time, writes, write_bytes, write_time, writebacks, writeback_time, extends, extend_bytes, extend_time, hits, evictions, reuses, fsyncs, fsync_time, stats_reset);
+pg_stat_kind_info| SELECT id,
+    name,
+    builtin,
+    fixed_amount,
+    accessed_across_databases,
+    write_to_file,
+    entry_size,
+    entry_count
+   FROM pg_stat_get_kind_info() k(id, name, builtin, fixed_amount, accessed_across_databases, write_to_file, entry_size, entry_count);
 pg_stat_lock| SELECT locktype,
     waits,
     wait_time,
diff --git a/src/test/regress/expected/stats.out b/src/test/regress/expected/stats.out
index fa550676f835..932613a6e767 100644
--- a/src/test/regress/expected/stats.out
+++ b/src/test/regress/expected/stats.out
@@ -113,6 +113,29 @@ walwriter|wal|init
 walwriter|wal|normal
 (95 rows)
 \a
+-- List of loaded statistics kinds.
+SELECT name, id, fixed_amount,
+    accessed_across_databases AS across_db, write_to_file
+  FROM pg_stat_kind_info
+  WHERE builtin
+  ORDER BY name COLLATE "C";
+     name     | id | fixed_amount | across_db | write_to_file 
+--------------+----+--------------+-----------+---------------
+ archiver     |  7 | t            | f         | t
+ backend      |  6 | f            | t         | f
+ bgwriter     |  8 | t            | f         | t
+ checkpointer |  9 | t            | f         | t
+ database     |  1 | f            | t         | t
+ function     |  3 | f            | f         | t
+ io           | 10 | t            | f         | t
+ lock         | 11 | t            | f         | t
+ relation     |  2 | f            | f         | t
+ replslot     |  4 | f            | t         | t
+ slru         | 12 | t            | f         | t
+ subscription |  5 | f            | t         | t
+ wal          | 13 | t            | f         | t
+(13 rows)
+
 -- ensure that both seqscan and indexscan plans are allowed
 SET enable_seqscan TO on;
 SET enable_indexscan TO on;
diff --git a/src/test/regress/expected/sysviews.out b/src/test/regress/expected/sysviews.out
index 132b56a5864c..ac9e033c2ae1 100644
--- a/src/test/regress/expected/sysviews.out
+++ b/src/test/regress/expected/sysviews.out
@@ -129,6 +129,13 @@ select count(*) > 0 as ok from pg_stat_slru;
  t
 (1 row)
 
+-- There should be at least one statistics kind loaded
+select count(*) > 0 as ok from pg_stat_kind_info;
+ ok 
+----
+ t
+(1 row)
+
 -- There must be only one record
 select count(*) = 1 as ok from pg_stat_wal;
  ok 
diff --git a/src/test/regress/sql/stats.sql b/src/test/regress/sql/stats.sql
index f5683302a75c..2c47c4b69b50 100644
--- a/src/test/regress/sql/stats.sql
+++ b/src/test/regress/sql/stats.sql
@@ -14,6 +14,13 @@ SELECT backend_type, object, context FROM pg_stat_io
   ORDER BY backend_type COLLATE "C", object COLLATE "C", context COLLATE "C";
 \a
 
+-- List of loaded statistics kinds.
+SELECT name, id, fixed_amount,
+    accessed_across_databases AS across_db, write_to_file
+  FROM pg_stat_kind_info
+  WHERE builtin
+  ORDER BY name COLLATE "C";
+
 -- ensure that both seqscan and indexscan plans are allowed
 SET enable_seqscan TO on;
 SET enable_indexscan TO on;
diff --git a/src/test/regress/sql/sysviews.sql b/src/test/regress/sql/sysviews.sql
index 507e400ad4af..193bf84dad86 100644
--- a/src/test/regress/sql/sysviews.sql
+++ b/src/test/regress/sql/sysviews.sql
@@ -70,6 +70,9 @@ select count(*) >= 0 as ok from pg_prepared_xacts;
 -- There will surely be at least one SLRU cache
 select count(*) > 0 as ok from pg_stat_slru;
 
+-- There should be at least one statistics kind loaded
+select count(*) > 0 as ok from pg_stat_kind_info;
+
 -- There must be only one record
 select count(*) = 1 as ok from pg_stat_wal;
 
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 2ec2bdd000bc..d77bb30bc588 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -509,6 +509,16 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
      </entry>
      </row>
 
+     <row>
+      <entry><structname>pg_stat_kind_info</structname><indexterm><primary>pg_stat_kind_info</primary></indexterm></entry>
+      <entry>
+       One row for each loaded statistics kind, showing information about
+       each kind.
+       See <link linkend="monitoring-pg-stat-kind-info-view">
+       <structname>pg_stat_kind_info</structname></link> for details.
+      </entry>
+     </row>
+
      <row>
       <entry><structname>pg_stat_lock</structname><indexterm><primary>pg_stat_lock</primary></indexterm></entry>
       <entry>
@@ -3303,6 +3313,138 @@ description | Waiting for a newly initialized WAL file to reach durable storage
  </sect2>
 
 
+ <sect2 id="monitoring-pg-stat-kind-info-view">
+  <title><structname>pg_stat_kind_info</structname></title>
+
+  <indexterm>
+   <primary>pg_stat_kind_info</primary>
+  </indexterm>
+
+  <para>
+   The <structname>pg_stat_kind_info</structname> view contains one row for each
+   loaded statistics kind, including both built-in and custom kinds.
+  </para>
+
+  <table id="pg-stat-kind-info-view" xreflabel="pg_stat_kind_info">
+   <title><structname>pg_stat_kind_info</structname> View</title>
+   <tgroup cols="1">
+    <thead>
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        Column Type
+       </para>
+       <para>
+        Description
+       </para>
+      </entry>
+     </row>
+    </thead>
+    <tbody>
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>id</structfield> <type>integer</type>
+       </para>
+       <para>
+        Numeric identifier of the statistics kind.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>name</structfield> <type>text</type>
+       </para>
+       <para>
+        Name of the statistics kind.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>builtin</structfield> <type>boolean</type>
+       </para>
+       <para>
+        True if this is a built-in statistics kind, false if it was registered
+        by an extension.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>fixed_amount</structfield> <type>boolean</type>
+       </para>
+       <para>
+        True if this kind tracks a fixed amount of data (a single, statically
+        allocated entry), false if it tracks a variable number of entries
+        keyed by object identifier.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>accessed_across_databases</structfield> <type>boolean</type>
+       </para>
+       <para>
+        True if entries of this kind are accessed across databases (cluster-wide
+        statistics), false if they are scoped to a single database.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>write_to_file</structfield> <type>boolean</type>
+       </para>
+       <para>
+        True if entries of this kind are persisted to the statistics file at
+        shutdown and reloaded on startup, false if they are kept only in
+        shared memory.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>entry_size</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Size in bytes of a shared memory entry for this statistics kind.
+        <literal>NULL</literal> for built-in fixed-amount kinds, whose
+        single entry lives in a statically-allocated slot rather than a
+        sized shared memory entry.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>entry_count</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Number of tracked entries for this kind. For variable-numbered kinds,
+        this is the number of objects currently tracked.
+        <literal>NULL</literal> for fixed-sized statistics kinds, or if the
+        kind does not track entry counts.
+       </para>
+      </entry>
+     </row>
+    </tbody>
+   </tgroup>
+  </table>
+ </sect2>
+
  <sect2 id="monitoring-pg-stat-lock-view">
   <title><structname>pg_stat_lock</structname></title>
 
-- 
2.54.0



Attachments:

  [text/plain] v3-0001-Add-pg_stat_kind_info-view.patch (16.5K, ../../[email protected]/2-v3-0001-Add-pg_stat_kind_info-view.patch)
  download | inline diff:
From 32b0910efdeeefb75ab3aa74100f446302a68a2e Mon Sep 17 00:00:00 2001
From: Michael Paquier <[email protected]>
Date: Wed, 1 Jul 2026 15:56:11 +0900
Subject: [PATCH v3] Add pg_stat_kind_info view

Blah..
---
 src/include/catalog/pg_proc.dat               |  10 ++
 src/backend/catalog/system_views.sql          |  12 ++
 src/backend/utils/activity/Makefile           |   1 +
 src/backend/utils/activity/meson.build        |   1 +
 src/backend/utils/activity/pgstat_kind.c      |  85 +++++++++++
 .../test_custom_stats/t/001_custom_stats.pl   |  14 +-
 src/test/regress/expected/rules.out           |   9 ++
 src/test/regress/expected/stats.out           |  23 +++
 src/test/regress/expected/sysviews.out        |   7 +
 src/test/regress/sql/stats.sql                |   7 +
 src/test/regress/sql/sysviews.sql             |   3 +
 doc/src/sgml/monitoring.sgml                  | 142 ++++++++++++++++++
 12 files changed, 313 insertions(+), 1 deletion(-)
 create mode 100644 src/backend/utils/activity/pgstat_kind.c

diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 73bb7fbb4304..9571f033aa85 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -6078,6 +6078,16 @@
   proargnames => '{backend_pid,backend_type,object,context,reads,read_bytes,read_time,writes,write_bytes,write_time,writebacks,writeback_time,extends,extend_bytes,extend_time,hits,evictions,reuses,fsyncs,fsync_time,stats_reset}',
   prosrc => 'pg_stat_get_backend_io' },
 
+{ oid => '8683',
+  descr => 'statistics: information about loaded statistics kinds',
+  proname => 'pg_stat_get_kind_info', prorows => '20', proretset => 't',
+  provolatile => 'v', proparallel => 'r', prorettype => 'record',
+  proargtypes => '',
+  proallargtypes => '{int4,text,bool,bool,bool,bool,int8,int8}',
+  proargmodes => '{o,o,o,o,o,o,o,o}',
+  proargnames => '{id,name,builtin,fixed_amount,accessed_across_databases,write_to_file,entry_size,entry_count}',
+  prosrc => 'pg_stat_get_kind_info' },
+
 { oid => '1136', descr => 'statistics: information about WAL activity',
   proname => 'pg_stat_get_wal', proisstrict => 'f', provolatile => 's',
   proparallel => 'r', prorettype => 'record', proargtypes => '',
diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql
index 8f129baec906..6a9d94d78f34 100644
--- a/src/backend/catalog/system_views.sql
+++ b/src/backend/catalog/system_views.sql
@@ -1282,6 +1282,18 @@ SELECT
        b.stats_reset
 FROM pg_stat_get_io() b;
 
+CREATE VIEW pg_stat_kind_info AS
+    SELECT
+        k.id,
+        k.name,
+        k.builtin,
+        k.fixed_amount,
+        k.accessed_across_databases,
+        k.write_to_file,
+        k.entry_size,
+        k.entry_count
+    FROM pg_stat_get_kind_info() k;
+
 CREATE VIEW pg_stat_wal AS
     SELECT
         w.wal_records,
diff --git a/src/backend/utils/activity/Makefile b/src/backend/utils/activity/Makefile
index ca3ef89bf599..5fed953c28a7 100644
--- a/src/backend/utils/activity/Makefile
+++ b/src/backend/utils/activity/Makefile
@@ -26,6 +26,7 @@ OBJS = \
 	pgstat_database.o \
 	pgstat_function.o \
 	pgstat_io.o \
+	pgstat_kind.o \
 	pgstat_lock.o \
 	pgstat_relation.o \
 	pgstat_replslot.o \
diff --git a/src/backend/utils/activity/meson.build b/src/backend/utils/activity/meson.build
index 1aa7ece52908..470b5dac402b 100644
--- a/src/backend/utils/activity/meson.build
+++ b/src/backend/utils/activity/meson.build
@@ -11,6 +11,7 @@ backend_sources += files(
   'pgstat_database.c',
   'pgstat_function.c',
   'pgstat_io.c',
+  'pgstat_kind.c',
   'pgstat_lock.c',
   'pgstat_relation.c',
   'pgstat_replslot.c',
diff --git a/src/backend/utils/activity/pgstat_kind.c b/src/backend/utils/activity/pgstat_kind.c
new file mode 100644
index 000000000000..bc43553170b5
--- /dev/null
+++ b/src/backend/utils/activity/pgstat_kind.c
@@ -0,0 +1,85 @@
+/*-------------------------------------------------------------------------
+ *
+ * pgstat_kind.c
+ *	  Functions related to statistics kinds.
+ *
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ *
+ * IDENTIFICATION
+ *	  src/backend/utils/activity/pgstat_kind.c
+ *
+ *-------------------------------------------------------------------------
+ */
+#include "postgres.h"
+
+#include "fmgr.h"
+#include "funcapi.h"
+#include "utils/builtins.h"
+#include "utils/fmgrprotos.h"
+#include "utils/pgstat_internal.h"
+#include "utils/pgstat_kind.h"
+#include "utils/tuplestore.h"
+
+
+/*
+ * pg_stat_get_kind_info
+ *
+ * Get information about the statistics kinds loaded into the system.
+ */
+Datum
+pg_stat_get_kind_info(PG_FUNCTION_ARGS)
+{
+#define PG_STAT_KIND_INFO_COLS	8
+	ReturnSetInfo *rsinfo;
+
+	InitMaterializedSRF(fcinfo, 0);
+	rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
+
+	for (int kind = PGSTAT_KIND_MIN; kind <= PGSTAT_KIND_MAX; kind++)
+	{
+		Datum		values[PG_STAT_KIND_INFO_COLS] = {0};
+		bool		nulls[PG_STAT_KIND_INFO_COLS] = {0};
+		const PgStat_KindInfo *info;
+
+		info = pgstat_get_kind_info(kind);
+		if (info == NULL)
+			continue;
+
+		values[0] = Int32GetDatum(kind);
+		values[1] = CStringGetTextDatum(info->name);
+
+		values[2] = BoolGetDatum(pgstat_is_kind_builtin(kind));
+		values[3] = BoolGetDatum(info->fixed_amount);
+		values[4] = BoolGetDatum(info->accessed_across_databases);
+		values[5] = BoolGetDatum(info->write_to_file);
+
+		/*
+		 * Built-in fixed-amount kinds store their single entry in
+		 * PgStat_ShmemControl, so shared_size is unused and left zero in
+		 * their PgStat_KindInfo.  Reporting it would be misleading, so report
+		 * NULL instead.  Custom fixed-amount kinds declare shared_size to
+		 * size their slot in custom_data[].
+		 */
+		if (info->fixed_amount && pgstat_is_kind_builtin(kind))
+			nulls[6] = true;
+		else
+			values[6] = Int64GetDatum(info->shared_size);
+
+		/*
+		 * When track_entry_count is disabled, use NULL.  Fixed-sized stats
+		 * kinds report NULL here.
+		 */
+		if (info->track_entry_count)
+			values[7] = Int64GetDatum(pgstat_get_entry_count(kind));
+		else
+			nulls[7] = true;
+
+
+		tuplestore_putvalues(rsinfo->setResult, rsinfo->setDesc, values, nulls);
+	}
+
+	return (Datum) 0;
+#undef PG_STAT_KIND_INFO_COLS
+}
diff --git a/src/test/modules/test_custom_stats/t/001_custom_stats.pl b/src/test/modules/test_custom_stats/t/001_custom_stats.pl
index 9e6a7a385775..f1774ba6f925 100644
--- a/src/test/modules/test_custom_stats/t/001_custom_stats.pl
+++ b/src/test/modules/test_custom_stats/t/001_custom_stats.pl
@@ -27,6 +27,18 @@ $node->start;
 $node->safe_psql('postgres', q(CREATE EXTENSION test_custom_var_stats));
 $node->safe_psql('postgres', q(CREATE EXTENSION test_custom_fixed_stats));
 
+# Verify custom stats kinds appear in pg_stat_kind_info.
+my $result = $node->safe_psql(
+	'postgres',
+	q(SELECT id, name, builtin, fixed_amount, accessed_across_databases,
+	         write_to_file, entry_size > 0
+	    FROM pg_stat_kind_info
+	    WHERE name LIKE 'test_custom%' ORDER BY id));
+is( $result,
+	qq{25|test_custom_var_stats|f|f|t|t|t
+26|test_custom_fixed_stats|f|t|f|t|t},
+	"custom stats kinds visible in pg_stat_kind_info");
+
 # Create entries for variable-sized stats.
 $node->safe_psql('postgres',
 	q(select test_custom_stats_var_create('entry1', 'Test entry 1')));
@@ -63,7 +75,7 @@ $node->safe_psql('postgres', q(select test_custom_stats_fixed_update()));
 $node->safe_psql('postgres', q(select test_custom_stats_fixed_update()));
 
 # Test data reports.
-my $result = $node->safe_psql('postgres',
+$result = $node->safe_psql('postgres',
 	q(select * from test_custom_stats_var_report('entry1')));
 is( $result,
 	"entry1|2|Test entry 1",
diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out
index a65a5bf0c4fb..4ed7b31528f9 100644
--- a/src/test/regress/expected/rules.out
+++ b/src/test/regress/expected/rules.out
@@ -1967,6 +1967,15 @@ pg_stat_io| SELECT backend_type,
     fsync_time,
     stats_reset
    FROM pg_stat_get_io() b(backend_type, object, context, reads, read_bytes, read_time, writes, write_bytes, write_time, writebacks, writeback_time, extends, extend_bytes, extend_time, hits, evictions, reuses, fsyncs, fsync_time, stats_reset);
+pg_stat_kind_info| SELECT id,
+    name,
+    builtin,
+    fixed_amount,
+    accessed_across_databases,
+    write_to_file,
+    entry_size,
+    entry_count
+   FROM pg_stat_get_kind_info() k(id, name, builtin, fixed_amount, accessed_across_databases, write_to_file, entry_size, entry_count);
 pg_stat_lock| SELECT locktype,
     waits,
     wait_time,
diff --git a/src/test/regress/expected/stats.out b/src/test/regress/expected/stats.out
index fa550676f835..932613a6e767 100644
--- a/src/test/regress/expected/stats.out
+++ b/src/test/regress/expected/stats.out
@@ -113,6 +113,29 @@ walwriter|wal|init
 walwriter|wal|normal
 (95 rows)
 \a
+-- List of loaded statistics kinds.
+SELECT name, id, fixed_amount,
+    accessed_across_databases AS across_db, write_to_file
+  FROM pg_stat_kind_info
+  WHERE builtin
+  ORDER BY name COLLATE "C";
+     name     | id | fixed_amount | across_db | write_to_file 
+--------------+----+--------------+-----------+---------------
+ archiver     |  7 | t            | f         | t
+ backend      |  6 | f            | t         | f
+ bgwriter     |  8 | t            | f         | t
+ checkpointer |  9 | t            | f         | t
+ database     |  1 | f            | t         | t
+ function     |  3 | f            | f         | t
+ io           | 10 | t            | f         | t
+ lock         | 11 | t            | f         | t
+ relation     |  2 | f            | f         | t
+ replslot     |  4 | f            | t         | t
+ slru         | 12 | t            | f         | t
+ subscription |  5 | f            | t         | t
+ wal          | 13 | t            | f         | t
+(13 rows)
+
 -- ensure that both seqscan and indexscan plans are allowed
 SET enable_seqscan TO on;
 SET enable_indexscan TO on;
diff --git a/src/test/regress/expected/sysviews.out b/src/test/regress/expected/sysviews.out
index 132b56a5864c..ac9e033c2ae1 100644
--- a/src/test/regress/expected/sysviews.out
+++ b/src/test/regress/expected/sysviews.out
@@ -129,6 +129,13 @@ select count(*) > 0 as ok from pg_stat_slru;
  t
 (1 row)
 
+-- There should be at least one statistics kind loaded
+select count(*) > 0 as ok from pg_stat_kind_info;
+ ok 
+----
+ t
+(1 row)
+
 -- There must be only one record
 select count(*) = 1 as ok from pg_stat_wal;
  ok 
diff --git a/src/test/regress/sql/stats.sql b/src/test/regress/sql/stats.sql
index f5683302a75c..2c47c4b69b50 100644
--- a/src/test/regress/sql/stats.sql
+++ b/src/test/regress/sql/stats.sql
@@ -14,6 +14,13 @@ SELECT backend_type, object, context FROM pg_stat_io
   ORDER BY backend_type COLLATE "C", object COLLATE "C", context COLLATE "C";
 \a
 
+-- List of loaded statistics kinds.
+SELECT name, id, fixed_amount,
+    accessed_across_databases AS across_db, write_to_file
+  FROM pg_stat_kind_info
+  WHERE builtin
+  ORDER BY name COLLATE "C";
+
 -- ensure that both seqscan and indexscan plans are allowed
 SET enable_seqscan TO on;
 SET enable_indexscan TO on;
diff --git a/src/test/regress/sql/sysviews.sql b/src/test/regress/sql/sysviews.sql
index 507e400ad4af..193bf84dad86 100644
--- a/src/test/regress/sql/sysviews.sql
+++ b/src/test/regress/sql/sysviews.sql
@@ -70,6 +70,9 @@ select count(*) >= 0 as ok from pg_prepared_xacts;
 -- There will surely be at least one SLRU cache
 select count(*) > 0 as ok from pg_stat_slru;
 
+-- There should be at least one statistics kind loaded
+select count(*) > 0 as ok from pg_stat_kind_info;
+
 -- There must be only one record
 select count(*) = 1 as ok from pg_stat_wal;
 
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 2ec2bdd000bc..d77bb30bc588 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -509,6 +509,16 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
      </entry>
      </row>
 
+     <row>
+      <entry><structname>pg_stat_kind_info</structname><indexterm><primary>pg_stat_kind_info</primary></indexterm></entry>
+      <entry>
+       One row for each loaded statistics kind, showing information about
+       each kind.
+       See <link linkend="monitoring-pg-stat-kind-info-view">
+       <structname>pg_stat_kind_info</structname></link> for details.
+      </entry>
+     </row>
+
      <row>
       <entry><structname>pg_stat_lock</structname><indexterm><primary>pg_stat_lock</primary></indexterm></entry>
       <entry>
@@ -3303,6 +3313,138 @@ description | Waiting for a newly initialized WAL file to reach durable storage
  </sect2>
 
 
+ <sect2 id="monitoring-pg-stat-kind-info-view">
+  <title><structname>pg_stat_kind_info</structname></title>
+
+  <indexterm>
+   <primary>pg_stat_kind_info</primary>
+  </indexterm>
+
+  <para>
+   The <structname>pg_stat_kind_info</structname> view contains one row for each
+   loaded statistics kind, including both built-in and custom kinds.
+  </para>
+
+  <table id="pg-stat-kind-info-view" xreflabel="pg_stat_kind_info">
+   <title><structname>pg_stat_kind_info</structname> View</title>
+   <tgroup cols="1">
+    <thead>
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        Column Type
+       </para>
+       <para>
+        Description
+       </para>
+      </entry>
+     </row>
+    </thead>
+    <tbody>
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>id</structfield> <type>integer</type>
+       </para>
+       <para>
+        Numeric identifier of the statistics kind.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>name</structfield> <type>text</type>
+       </para>
+       <para>
+        Name of the statistics kind.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>builtin</structfield> <type>boolean</type>
+       </para>
+       <para>
+        True if this is a built-in statistics kind, false if it was registered
+        by an extension.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>fixed_amount</structfield> <type>boolean</type>
+       </para>
+       <para>
+        True if this kind tracks a fixed amount of data (a single, statically
+        allocated entry), false if it tracks a variable number of entries
+        keyed by object identifier.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>accessed_across_databases</structfield> <type>boolean</type>
+       </para>
+       <para>
+        True if entries of this kind are accessed across databases (cluster-wide
+        statistics), false if they are scoped to a single database.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>write_to_file</structfield> <type>boolean</type>
+       </para>
+       <para>
+        True if entries of this kind are persisted to the statistics file at
+        shutdown and reloaded on startup, false if they are kept only in
+        shared memory.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>entry_size</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Size in bytes of a shared memory entry for this statistics kind.
+        <literal>NULL</literal> for built-in fixed-amount kinds, whose
+        single entry lives in a statically-allocated slot rather than a
+        sized shared memory entry.
+       </para>
+      </entry>
+     </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>entry_count</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Number of tracked entries for this kind. For variable-numbered kinds,
+        this is the number of objects currently tracked.
+        <literal>NULL</literal> for fixed-sized statistics kinds, or if the
+        kind does not track entry counts.
+       </para>
+      </entry>
+     </row>
+    </tbody>
+   </tgroup>
+  </table>
+ </sect2>
+
  <sect2 id="monitoring-pg-stat-lock-view">
   <title><structname>pg_stat_lock</structname></title>
 
-- 
2.54.0



  [application/pgp-signature] signature.asc (833B, ../../[email protected]/3-signature.asc)
  download

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

* Re: Add pg_stat_kind_info system view
@ 2026-07-01 08:38  Bertrand Drouvot <[email protected]>
  parent: Michael Paquier <[email protected]>
  0 siblings, 1 reply; 67+ messages in thread

From: Bertrand Drouvot @ 2026-07-01 08:38 UTC (permalink / raw)
  To: Michael Paquier <[email protected]>; +Cc: Sami Imseih <[email protected]>; Tristan Partin <[email protected]>; pgsql-hackers

Hi,

On Wed, Jul 01, 2026 at 04:07:06PM +0900, Michael Paquier wrote:
> On Tue, Jun 30, 2026 at 11:17:29PM -0500, Sami Imseih wrote:
> >>> IMO, in this case, NULL should be a synonym of "I don't know", which
> >>> is what entry_count set to false means.  0 means "I know, there is no
> >>> data".  I'd be OK with dropping the part about fixed-sized stats where
> >>> we enforce 1, and use NULL instead, though.
> >>
> >> +1, that's also my opinion [1].
> >
> > I'm ok with that if others feel this is better.
> 
> Okay, thanks.  Let's do so then.  Let's also invent a new
> pgstat_kind.c in activity/.
> 
> I have been chewing a bit on the comments from Sami, leading to the
> following result:
> - Switched shared_size to entry_size, for consistency with
> entry_count, but I don't agree about the use of shared_data_len.
> shared_size is more adapted to me because it has the entry overhead
> and the shmem entry header.  That's more precise and one does not need
> to guess the header size.
> - Moved entry_count after entry_size in the list of attributes.
> - written_to_file -> write_to_file, same as pgstat_internal.h.
> - Moved the new function to a pgstat_kind.c.
> - Some extra changes and tweaks to the comments, the docs, some code.
> 
> The attached should do all that, hopefully.  Any thoughts?

Yeah I also think it does all of that and LGTM.

Nit:

$ git show | grep -i loaded
+       One row for each loaded statistics kind, showing information about
+   loaded statistics kind, including both built-in and custom kinds.
+        shutdown and reloaded on startup, false if they are kept only in
+ * Get information about the statistics kinds loaded into the system.
+  descr => 'statistics: information about loaded statistics kinds',
+-- List of loaded statistics kinds.
+-- There should be at least one statistics kind loaded
+-- List of loaded statistics kinds.
+-- There should be at least one statistics kind loaded

s/loaded/registered/?

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com





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

* Re: Add pg_stat_kind_info system view
@ 2026-07-01 17:21  Sami Imseih <[email protected]>
  parent: Bertrand Drouvot <[email protected]>
  0 siblings, 1 reply; 67+ messages in thread

From: Sami Imseih @ 2026-07-01 17:21 UTC (permalink / raw)
  To: Bertrand Drouvot <[email protected]>; +Cc: Michael Paquier <[email protected]>; Tristan Partin <[email protected]>; pgsql-hackers

> On Wed, Jul 01, 2026 at 04:07:06PM +0900, Michael Paquier wrote:
> > On Tue, Jun 30, 2026 at 11:17:29PM -0500, Sami Imseih wrote:
> > >>> IMO, in this case, NULL should be a synonym of "I don't know", which
> > >>> is what entry_count set to false means.  0 means "I know, there is no
> > >>> data".  I'd be OK with dropping the part about fixed-sized stats where
> > >>> we enforce 1, and use NULL instead, though.
> > >>
> > >> +1, that's also my opinion [1].
> > >
> > > I'm ok with that if others feel this is better.
> >
> > Okay, thanks.  Let's do so then.  Let's also invent a new
> > pgstat_kind.c in activity/.
> >
> > I have been chewing a bit on the comments from Sami, leading to the
> > following result:
> > - Switched shared_size to entry_size, for consistency with
> > entry_count, but I don't agree about the use of shared_data_len.
> > shared_size is more adapted to me because it has the entry overhead
> > and the shmem entry header.  That's more precise and one does not need
> > to guess the header size.

It still does not include PgStatShared_HashEntry which is 40-bytes per entry,
so it could add up if someone is calculating total consumption by a kind as
number_of_entries * size_of_entry. So that should also be accounted for, right?

But also, because this will be used to calculate consumption, we
should add a note in
the documentation to differentiate between live storage usage vs the
DSA footprint,
which will not be shrunk when entries are deleted. Someone may be confused
that their entries are much lower after deleting entries, but their memory
footprint is still high because the OS does not reclaim the free'd space.
What do you think?

--
Sami






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

* Re: Add pg_stat_kind_info system view
@ 2026-07-01 21:28  Michael Paquier <[email protected]>
  parent: Sami Imseih <[email protected]>
  0 siblings, 1 reply; 67+ messages in thread

From: Michael Paquier @ 2026-07-01 21:28 UTC (permalink / raw)
  To: Sami Imseih <[email protected]>; +Cc: Bertrand Drouvot <[email protected]>; Tristan Partin <[email protected]>; pgsql-hackers

On Wed, Jul 01, 2026 at 12:21:39PM -0500, Sami Imseih wrote:
> It still does not include PgStatShared_HashEntry which is 40-bytes per entry,
> so it could add up if someone is calculating total consumption by a kind as
> number_of_entries * size_of_entry. So that should also be accounted
> for, right?

Right.  I forgot about this part.  HashEntry stands on top of the
PgStatShared_* structures.

> But also, because this will be used to calculate consumption, we
> should add a note in
> the documentation to differentiate between live storage usage vs the
> DSA footprint,
> which will not be shrunk when entries are deleted. Someone may be confused
> that their entries are much lower after deleting entries, but their memory
> footprint is still high because the OS does not reclaim the free'd space.
> What do you think?

Hmm.  I am not completely sure which way is best here.  So, I think
that I am just going to drop this field for now (entry_size as of
latest patch), and keep the rest of the patch.  It's still useful to
me, and we could always add one or more memory-related field later as
we feel in this release cycle.
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../../[email protected]/2-signature.asc)
  download

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

* Re: Add pg_stat_kind_info system view
@ 2026-07-02 00:26  Sami Imseih <[email protected]>
  parent: Michael Paquier <[email protected]>
  0 siblings, 1 reply; 67+ messages in thread

From: Sami Imseih @ 2026-07-02 00:26 UTC (permalink / raw)
  To: Michael Paquier <[email protected]>; +Cc: Bertrand Drouvot <[email protected]>; Tristan Partin <[email protected]>; pgsql-hackers

> > But also, because this will be used to calculate consumption, we
> > should add a note in
> > the documentation to differentiate between live storage usage vs the
> > DSA footprint,
> > which will not be shrunk when entries are deleted. Someone may be confused
> > that their entries are much lower after deleting entries, but their memory
> > footprint is still high because the OS does not reclaim the free'd space.
> > What do you think?
>
> Hmm.  I am not completely sure which way is best here.  So, I think
> that I am just going to drop this field for now (entry_size as of
> latest patch), and keep the rest of the patch.  It's still useful to
> me, and we could always add one or more memory-related field later as
> we feel in this release cycle.

Right. I also think this needs more discussion, and it should not hold
up everything else.

--
Sami





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

* Re: Add pg_stat_kind_info system view
@ 2026-07-02 00:37  Michael Paquier <[email protected]>
  parent: Sami Imseih <[email protected]>
  0 siblings, 1 reply; 67+ messages in thread

From: Michael Paquier @ 2026-07-02 00:37 UTC (permalink / raw)
  To: Sami Imseih <[email protected]>; +Cc: Bertrand Drouvot <[email protected]>; Tristan Partin <[email protected]>; pgsql-hackers

On Wed, Jul 01, 2026 at 07:26:23PM -0500, Sami Imseih wrote:
> Right. I also think this needs more discussion, and it should not hold
> up everything else.

Just done this way now as of 3b066de6c0a1, with more more adjustments,
and without the sizing parts.
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../../[email protected]/2-signature.asc)
  download

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

* Re: Add pg_stat_kind_info system view
@ 2026-07-06 22:52  Tristan Partin <[email protected]>
  parent: Michael Paquier <[email protected]>
  0 siblings, 0 replies; 67+ messages in thread

From: Tristan Partin @ 2026-07-06 22:52 UTC (permalink / raw)
  To: Michael Paquier <[email protected]>; Sami Imseih <[email protected]>; +Cc: Bertrand Drouvot <[email protected]>; pgsql-hackers

On Thu Jul 2, 2026 at 12:37 AM UTC, Michael Paquier wrote:
> On Wed, Jul 01, 2026 at 07:26:23PM -0500, Sami Imseih wrote:
>> Right. I also think this needs more discussion, and it should not hold
>> up everything else.
>
> Just done this way now as of 3b066de6c0a1, with more more adjustments,
> and without the sizing parts.

Thanks for committing Michael, and thanks for the reviews Bertrand and 
Sami. Here is a patch that add the aforementioned entry_size column. It 
is definitely needs further discussion. I am not entirely sure that 
I see the value of using PgStat_KindInfo::shared_size for this column, 
so I used PgStat_KindInfo::shared_data_len instead via 
pgstat_get_entry_len(). My reasoning for choosing so is:

- An argument against shared_size is that I think trying to match up
  pg_stat_kind_info with pg_shmem_allocations will not work well because 
  we will miss the additional hash table overhead
- Additionally, a few builtin stats don't even report a shared_size 
  (bgwriter, archiver, checkpointer, etc.)

Looking forward to see what other ideas or reasonings you all might 
propose.

-- 
Tristan Partin
PostgreSQL Contributors Team
AWS (https://aws.amazon.com)


Attachments:

  [text/x-patch] v1-0001-Add-entry_size-column-to-pg_stat_kind_info.patch (8.6K, ../../[email protected]/2-v1-0001-Add-entry_size-column-to-pg_stat_kind_info.patch)
  download | inline diff:
From 97f87ae42e339d5d30d30c35f80ee9d7db75dca6 Mon Sep 17 00:00:00 2001
From: Tristan Partin <[email protected]>
Date: Mon, 6 Jul 2026 22:30:12 +0000
Subject: [PATCH v1] Add entry_size column to pg_stat_kind_info

pg_stat_kind_info lacked a way to inspect the size of the statistics
data payload for each registered kind. The column represents
PgStat_KindInfo::shared_data_len, which is the size of the serializable
statistics data payload, excluding shared memory wrapper overhead such
as locking structures and hash table bookkeeping.

Signed-off-by: Tristan Partin <[email protected]>
---
 doc/src/sgml/monitoring.sgml                  | 13 +++++++
 src/backend/catalog/system_views.sql          |  3 +-
 src/backend/utils/activity/pgstat_kind.c      |  4 ++-
 src/include/catalog/pg_proc.dat               |  6 ++--
 .../test_custom_stats/t/001_custom_stats.pl   |  8 ++---
 src/test/regress/expected/rules.out           |  5 +--
 src/test/regress/expected/stats.out           | 34 +++++++++----------
 src/test/regress/sql/stats.sql                |  4 +--
 8 files changed, 47 insertions(+), 30 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 12b9ee20d4a..76b43d0b38c 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -3426,6 +3426,19 @@ description | Waiting for a newly initialized WAL file to reach durable storage
        </para>
       </entry>
      </row>
+
+     <row>
+      <entry role="catalog_table_entry">
+       <para role="column_definition">
+        <structfield>entry_size</structfield> <type>bigint</type>
+       </para>
+       <para>
+        Size of the statistics data for each entry of this kind in bytes. This
+        reflects the serializable statistics payload only, and does not include
+        any shared memory overhead.
+       </para>
+      </entry>
+     </row>
     </tbody>
    </tgroup>
   </table>
diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql
index 6c1c5545cb5..a1196be6e54 100644
--- a/src/backend/catalog/system_views.sql
+++ b/src/backend/catalog/system_views.sql
@@ -1290,7 +1290,8 @@ CREATE VIEW pg_stat_kind_info AS
         k.fixed_amount,
         k.accessed_across_databases,
         k.write_to_file,
-        k.entry_count
+        k.entry_count,
+        k.entry_size
     FROM pg_stat_get_kind_info() k;
 
 CREATE VIEW pg_stat_wal AS
diff --git a/src/backend/utils/activity/pgstat_kind.c b/src/backend/utils/activity/pgstat_kind.c
index 6c53b7e49bf..e9e636b34aa 100644
--- a/src/backend/utils/activity/pgstat_kind.c
+++ b/src/backend/utils/activity/pgstat_kind.c
@@ -31,7 +31,7 @@
 Datum
 pg_stat_get_kind_info(PG_FUNCTION_ARGS)
 {
-#define PG_STAT_KIND_INFO_COLS	7
+#define PG_STAT_KIND_INFO_COLS	8
 	ReturnSetInfo *rsinfo;
 
 	InitMaterializedSRF(fcinfo, 0);
@@ -64,6 +64,8 @@ pg_stat_get_kind_info(PG_FUNCTION_ARGS)
 		else
 			nulls[6] = true;
 
+		values[7] = Int64GetDatum((int64) pgstat_get_entry_len(kind));
+
 		tuplestore_putvalues(rsinfo->setResult, rsinfo->setDesc, values, nulls);
 	}
 
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 3cb84359adf..89d13d01184 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -6081,9 +6081,9 @@
 { oid => '8683', descr => 'statistics: information about statistics kinds',
   proname => 'pg_stat_get_kind_info', prorows => '20', proretset => 't',
   provolatile => 'v', proparallel => 'r', prorettype => 'record',
-  proargtypes => '', proallargtypes => '{int4,text,bool,bool,bool,bool,int8}',
-  proargmodes => '{o,o,o,o,o,o,o}',
-  proargnames => '{id,name,builtin,fixed_amount,accessed_across_databases,write_to_file,entry_count}',
+  proargtypes => '', proallargtypes => '{int4,text,bool,bool,bool,bool,int8,int8}',
+  proargmodes => '{o,o,o,o,o,o,o,o}',
+  proargnames => '{id,name,builtin,fixed_amount,accessed_across_databases,write_to_file,entry_count,entry_size}',
   prosrc => 'pg_stat_get_kind_info' },
 
 { oid => '1136', descr => 'statistics: information about WAL activity',
diff --git a/src/test/modules/test_custom_stats/t/001_custom_stats.pl b/src/test/modules/test_custom_stats/t/001_custom_stats.pl
index 69f2284229e..ee291f4ac13 100644
--- a/src/test/modules/test_custom_stats/t/001_custom_stats.pl
+++ b/src/test/modules/test_custom_stats/t/001_custom_stats.pl
@@ -31,12 +31,12 @@
 my $result = $node->safe_psql(
 	'postgres',
 	q(SELECT id, name, builtin, fixed_amount, accessed_across_databases,
-	         write_to_file
+	         write_to_file, entry_size > 0
 	    FROM pg_stat_kind_info
 	    WHERE name LIKE 'test_custom%' ORDER BY id));
-is( $result,
-	qq{25|test_custom_var_stats|f|f|t|t
-26|test_custom_fixed_stats|f|t|f|t},
+is($result,
+	qq{25|test_custom_var_stats|f|f|t|t|t
+26|test_custom_fixed_stats|f|t|f|t|t},
 	"custom stats kinds visible in pg_stat_kind_info");
 
 # Create entries for variable-sized stats.
diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out
index 39905c2de14..f623b06910a 100644
--- a/src/test/regress/expected/rules.out
+++ b/src/test/regress/expected/rules.out
@@ -1973,8 +1973,9 @@ pg_stat_kind_info| SELECT id,
     fixed_amount,
     accessed_across_databases,
     write_to_file,
-    entry_count
-   FROM pg_stat_get_kind_info() k(id, name, builtin, fixed_amount, accessed_across_databases, write_to_file, entry_count);
+    entry_count,
+    entry_size
+   FROM pg_stat_get_kind_info() k(id, name, builtin, fixed_amount, accessed_across_databases, write_to_file, entry_count, entry_size);
 pg_stat_lock| SELECT locktype,
     waits,
     wait_time,
diff --git a/src/test/regress/expected/stats.out b/src/test/regress/expected/stats.out
index 03cbc1cdef5..c8479c0faf7 100644
--- a/src/test/regress/expected/stats.out
+++ b/src/test/regress/expected/stats.out
@@ -114,26 +114,26 @@ walwriter|wal|normal
 (95 rows)
 \a
 -- List of registered statistics kinds.
-SELECT id, name, fixed_amount,
-    accessed_across_databases AS across_db, write_to_file
+SELECT id, name, fixed_amount, accessed_across_databases AS across_db,
+       write_to_file, entry_size > 0 AS has_entry_size
   FROM pg_stat_kind_info
   WHERE builtin
   ORDER BY id;
- id |     name     | fixed_amount | across_db | write_to_file 
-----+--------------+--------------+-----------+---------------
-  1 | database     | f            | t         | t
-  2 | relation     | f            | f         | t
-  3 | function     | f            | f         | t
-  4 | replslot     | f            | t         | t
-  5 | subscription | f            | t         | t
-  6 | backend      | f            | t         | f
-  7 | archiver     | t            | f         | t
-  8 | bgwriter     | t            | f         | t
-  9 | checkpointer | t            | f         | t
- 10 | io           | t            | f         | t
- 11 | lock         | t            | f         | t
- 12 | slru         | t            | f         | t
- 13 | wal          | t            | f         | t
+ id |     name     | fixed_amount | across_db | write_to_file | has_entry_size 
+----+--------------+--------------+-----------+---------------+----------------
+  1 | database     | f            | t         | t             | t
+  2 | relation     | f            | f         | t             | t
+  3 | function     | f            | f         | t             | t
+  4 | replslot     | f            | t         | t             | t
+  5 | subscription | f            | t         | t             | t
+  6 | backend      | f            | t         | f             | t
+  7 | archiver     | t            | f         | t             | t
+  8 | bgwriter     | t            | f         | t             | t
+  9 | checkpointer | t            | f         | t             | t
+ 10 | io           | t            | f         | t             | t
+ 11 | lock         | t            | f         | t             | t
+ 12 | slru         | t            | f         | t             | t
+ 13 | wal          | t            | f         | t             | t
 (13 rows)
 
 -- ensure that both seqscan and indexscan plans are allowed
diff --git a/src/test/regress/sql/stats.sql b/src/test/regress/sql/stats.sql
index 4c265d1245c..554e6068aa5 100644
--- a/src/test/regress/sql/stats.sql
+++ b/src/test/regress/sql/stats.sql
@@ -15,8 +15,8 @@ SELECT backend_type, object, context FROM pg_stat_io
 \a
 
 -- List of registered statistics kinds.
-SELECT id, name, fixed_amount,
-    accessed_across_databases AS across_db, write_to_file
+SELECT id, name, fixed_amount, accessed_across_databases AS across_db,
+       write_to_file, entry_size > 0 AS has_entry_size
   FROM pg_stat_kind_info
   WHERE builtin
   ORDER BY id;
-- 
Tristan Partin
https://tristan.partin.io



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


end of thread, other threads:[~2026-07-06 22:52 UTC | newest]

Thread overview: 67+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH 03/12] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]>
2026-05-28 17:11 ` Re: Add pg_stat_kind_info system view Tristan Partin <[email protected]>
2026-06-01 05:40   ` Re: Add pg_stat_kind_info system view Michael Paquier <[email protected]>
2026-06-04 16:59     ` Re: Add pg_stat_kind_info system view Tristan Partin <[email protected]>
2026-06-08 00:16       ` Re: Add pg_stat_kind_info system view Michael Paquier <[email protected]>
2026-06-18 16:54         ` Re: Add pg_stat_kind_info system view Tristan Partin <[email protected]>
2026-06-24 04:12           ` Re: Add pg_stat_kind_info system view Michael Paquier <[email protected]>
2026-06-24 05:31             ` Re: Add pg_stat_kind_info system view Bertrand Drouvot <[email protected]>
2026-06-30 06:42               ` Re: Add pg_stat_kind_info system view Michael Paquier <[email protected]>
2026-06-30 07:59                 ` Re: Add pg_stat_kind_info system view Bertrand Drouvot <[email protected]>
2026-06-30 08:02                   ` Re: Add pg_stat_kind_info system view Michael Paquier <[email protected]>
2026-06-30 22:36                     ` Re: Add pg_stat_kind_info system view Sami Imseih <[email protected]>
2026-07-01 01:35                       ` Re: Add pg_stat_kind_info system view Michael Paquier <[email protected]>
2026-07-01 03:39                         ` Re: Add pg_stat_kind_info system view Bertrand Drouvot <[email protected]>
2026-07-01 04:17                           ` Re: Add pg_stat_kind_info system view Sami Imseih <[email protected]>
2026-07-01 07:07                             ` Re: Add pg_stat_kind_info system view Michael Paquier <[email protected]>
2026-07-01 08:38                               ` Re: Add pg_stat_kind_info system view Bertrand Drouvot <[email protected]>
2026-07-01 17:21                                 ` Re: Add pg_stat_kind_info system view Sami Imseih <[email protected]>
2026-07-01 21:28                                   ` Re: Add pg_stat_kind_info system view Michael Paquier <[email protected]>
2026-07-02 00:26                                     ` Re: Add pg_stat_kind_info system view Sami Imseih <[email protected]>
2026-07-02 00:37                                       ` Re: Add pg_stat_kind_info system view Michael Paquier <[email protected]>
2026-07-06 22:52                                         ` Re: Add pg_stat_kind_info system view Tristan Partin <[email protected]>
2026-06-11 06:35 ` Re: Add pg_stat_kind_info system view solai v <[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