public inbox for [email protected]help / color / mirror / Atom feed
[PATCH 03/12] psql: Add HIDE_COMPRESSAM for regress testing 50+ messages / 3 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ 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; 50+ 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] 50+ messages in thread
* Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index @ 2022-03-20 22:08 Tom Lane <[email protected]> 0 siblings, 1 reply; 50+ messages in thread From: Tom Lane @ 2022-03-20 22:08 UTC (permalink / raw) To: Andrei Zubkov <[email protected]>; +Cc: Michael Paquier <[email protected]>; PostgreSQL Hackers <[email protected]> Andrei Zubkov <[email protected]> writes: > On Tue, 2021-11-30 at 17:29 +0900, Michael Paquier wrote: >> Hmm. Why should we care about invalid indexes at all, including >> pg_statio_all_indexes? > I think we should care about them at least because they are exists and > can consume resources. For example, invalid index is to be updated by > DML operations. > Of course we can exclude such indexes from a view using isvalid, > isready, islive fields. But in such case we should mention this in the > docs, and more important is that the new such states of indexes can > appear in the future causing change in a view definition. Counting all > indexes regardless of states seems more reasonable to me. Yeah, I agree, especially since we do it like that for the table's own indexes. I have a couple of comments though: 1. There's a silly typo in the view definition (it outputs tidx_blks_read twice). Fixed in the attached v2. 2. Historically, if you put any constraints on the view output, like select * from pg_statio_all_tables where relname like 'foo%'; you'd get a commensurate reduction in the amount of work done. With this version, you don't: the CTE will get computed in its entirety even if we just need one row of its result. This seems pretty bad, especially for installations with many tables --- I suspect many users would think this cure is worse than the disease. I'm not quite sure what to do about #2. I thought of just removing X.indexrelid from the GROUP BY clause and summing over the toast index(es) as we do for the table's index(es). But that doesn't work: if there are N > 1 table indexes, then the counts for the toast index(es) will be multiplied by N, and conversely if there are multiple toast indexes then the counts for the table indexes will be scaled up. We need to sum separately over the table indexes and toast indexes, and I don't immediately see how to do that without creating an optimization fence. regards, tom lane Attachments: [text/x-diff] v2-0001-pg_statio_all_tables-several-rows-per-table.patch (4.7K, ../../[email protected]/2-v2-0001-pg_statio_all_tables-several-rows-per-table.patch) download | inline diff: diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql index bb1ac30cd1..a977efd3c5 100644 --- a/src/backend/catalog/system_views.sql +++ b/src/backend/catalog/system_views.sql @@ -710,6 +710,18 @@ CREATE VIEW pg_stat_xact_user_tables AS schemaname !~ '^pg_toast'; CREATE VIEW pg_statio_all_tables AS + WITH indstat AS ( + SELECT + indrelid, + sum(pg_stat_get_blocks_fetched(indexrelid) - + pg_stat_get_blocks_hit(indexrelid))::bigint + AS idx_blks_read, + sum(pg_stat_get_blocks_hit(indexrelid))::bigint + AS idx_blks_hit + FROM + pg_index + GROUP BY indrelid + ) SELECT C.oid AS relid, N.nspname AS schemaname, @@ -717,22 +729,19 @@ CREATE VIEW pg_statio_all_tables AS pg_stat_get_blocks_fetched(C.oid) - pg_stat_get_blocks_hit(C.oid) AS heap_blks_read, pg_stat_get_blocks_hit(C.oid) AS heap_blks_hit, - sum(pg_stat_get_blocks_fetched(I.indexrelid) - - pg_stat_get_blocks_hit(I.indexrelid))::bigint AS idx_blks_read, - sum(pg_stat_get_blocks_hit(I.indexrelid))::bigint AS idx_blks_hit, + I.idx_blks_read AS idx_blks_read, + I.idx_blks_hit AS idx_blks_hit, pg_stat_get_blocks_fetched(T.oid) - pg_stat_get_blocks_hit(T.oid) AS toast_blks_read, pg_stat_get_blocks_hit(T.oid) AS toast_blks_hit, - pg_stat_get_blocks_fetched(X.indexrelid) - - pg_stat_get_blocks_hit(X.indexrelid) AS tidx_blks_read, - pg_stat_get_blocks_hit(X.indexrelid) AS tidx_blks_hit + X.idx_blks_read AS tidx_blks_read, + X.idx_blks_hit AS tidx_blks_hit FROM pg_class C LEFT JOIN - pg_index I ON C.oid = I.indrelid LEFT JOIN + indstat I ON C.oid = I.indrelid LEFT JOIN pg_class T ON C.reltoastrelid = T.oid LEFT JOIN - pg_index X ON T.oid = X.indrelid + indstat X ON T.oid = X.indrelid LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) - WHERE C.relkind IN ('r', 't', 'm') - GROUP BY C.oid, N.nspname, C.relname, T.oid, X.indexrelid; + WHERE C.relkind IN ('r', 't', 'm'); CREATE VIEW pg_statio_sys_tables AS SELECT * FROM pg_statio_all_tables diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out index ac468568a1..df1a3c1297 100644 --- a/src/test/regress/expected/rules.out +++ b/src/test/regress/expected/rules.out @@ -2256,24 +2256,30 @@ pg_statio_all_sequences| SELECT c.oid AS relid, FROM (pg_class c LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) WHERE (c.relkind = 'S'::"char"); -pg_statio_all_tables| SELECT c.oid AS relid, +pg_statio_all_tables| WITH indstat AS ( + SELECT pg_index.indrelid, + (sum((pg_stat_get_blocks_fetched(pg_index.indexrelid) - pg_stat_get_blocks_hit(pg_index.indexrelid))))::bigint AS idx_blks_read, + (sum(pg_stat_get_blocks_hit(pg_index.indexrelid)))::bigint AS idx_blks_hit + FROM pg_index + GROUP BY pg_index.indrelid + ) + SELECT c.oid AS relid, n.nspname AS schemaname, c.relname, (pg_stat_get_blocks_fetched(c.oid) - pg_stat_get_blocks_hit(c.oid)) AS heap_blks_read, pg_stat_get_blocks_hit(c.oid) AS heap_blks_hit, - (sum((pg_stat_get_blocks_fetched(i.indexrelid) - pg_stat_get_blocks_hit(i.indexrelid))))::bigint AS idx_blks_read, - (sum(pg_stat_get_blocks_hit(i.indexrelid)))::bigint AS idx_blks_hit, + i.idx_blks_read, + i.idx_blks_hit, (pg_stat_get_blocks_fetched(t.oid) - pg_stat_get_blocks_hit(t.oid)) AS toast_blks_read, pg_stat_get_blocks_hit(t.oid) AS toast_blks_hit, - (pg_stat_get_blocks_fetched(x.indexrelid) - pg_stat_get_blocks_hit(x.indexrelid)) AS tidx_blks_read, - pg_stat_get_blocks_hit(x.indexrelid) AS tidx_blks_hit + x.idx_blks_read AS tidx_blks_read, + x.idx_blks_hit AS tidx_blks_hit FROM ((((pg_class c - LEFT JOIN pg_index i ON ((c.oid = i.indrelid))) + LEFT JOIN indstat i ON ((c.oid = i.indrelid))) LEFT JOIN pg_class t ON ((c.reltoastrelid = t.oid))) - LEFT JOIN pg_index x ON ((t.oid = x.indrelid))) + LEFT JOIN indstat x ON ((t.oid = x.indrelid))) LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) - WHERE (c.relkind = ANY (ARRAY['r'::"char", 't'::"char", 'm'::"char"])) - GROUP BY c.oid, n.nspname, c.relname, t.oid, x.indexrelid; + WHERE (c.relkind = ANY (ARRAY['r'::"char", 't'::"char", 'm'::"char"])); pg_statio_sys_indexes| SELECT pg_statio_all_indexes.relid, pg_statio_all_indexes.indexrelid, pg_statio_all_indexes.schemaname, ^ permalink raw reply [nested|flat] 50+ messages in thread
* Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index @ 2022-03-20 22:33 Tom Lane <[email protected]> parent: Tom Lane <[email protected]> 0 siblings, 1 reply; 50+ messages in thread From: Tom Lane @ 2022-03-20 22:33 UTC (permalink / raw) To: Andrei Zubkov <[email protected]>; +Cc: Michael Paquier <[email protected]>; PostgreSQL Hackers <[email protected]> I wrote: > ... We need to sum separately over the > table indexes and toast indexes, and I don't immediately see how > to do that without creating an optimization fence. After a bit of further fooling, I found that we could make that work with LEFT JOIN LATERAL. This formulation has a different problem, which is that if you do want most or all of the output, computing each sub-aggregation separately is probably less efficient than it could be. But this is probably the better way to go unless someone has an even better idea. regards, tom lane Attachments: [text/x-diff] v3-0001-pg_statio_all_tables-several-rows-per-table.patch (4.8K, ../../[email protected]/2-v3-0001-pg_statio_all_tables-several-rows-per-table.patch) download | inline diff: diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql index bb1ac30cd1..e319b99a9d 100644 --- a/src/backend/catalog/system_views.sql +++ b/src/backend/catalog/system_views.sql @@ -717,22 +717,31 @@ CREATE VIEW pg_statio_all_tables AS pg_stat_get_blocks_fetched(C.oid) - pg_stat_get_blocks_hit(C.oid) AS heap_blks_read, pg_stat_get_blocks_hit(C.oid) AS heap_blks_hit, - sum(pg_stat_get_blocks_fetched(I.indexrelid) - - pg_stat_get_blocks_hit(I.indexrelid))::bigint AS idx_blks_read, - sum(pg_stat_get_blocks_hit(I.indexrelid))::bigint AS idx_blks_hit, + I.idx_blks_read AS idx_blks_read, + I.idx_blks_hit AS idx_blks_hit, pg_stat_get_blocks_fetched(T.oid) - pg_stat_get_blocks_hit(T.oid) AS toast_blks_read, pg_stat_get_blocks_hit(T.oid) AS toast_blks_hit, - pg_stat_get_blocks_fetched(X.indexrelid) - - pg_stat_get_blocks_hit(X.indexrelid) AS tidx_blks_read, - pg_stat_get_blocks_hit(X.indexrelid) AS tidx_blks_hit + X.idx_blks_read AS tidx_blks_read, + X.idx_blks_hit AS tidx_blks_hit FROM pg_class C LEFT JOIN - pg_index I ON C.oid = I.indrelid LEFT JOIN - pg_class T ON C.reltoastrelid = T.oid LEFT JOIN - pg_index X ON T.oid = X.indrelid + pg_class T ON C.reltoastrelid = T.oid LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) - WHERE C.relkind IN ('r', 't', 'm') - GROUP BY C.oid, N.nspname, C.relname, T.oid, X.indexrelid; + LEFT JOIN LATERAL ( + SELECT sum(pg_stat_get_blocks_fetched(indexrelid) - + pg_stat_get_blocks_hit(indexrelid))::bigint + AS idx_blks_read, + sum(pg_stat_get_blocks_hit(indexrelid))::bigint + AS idx_blks_hit + FROM pg_index WHERE indrelid = C.oid ) I ON true + LEFT JOIN LATERAL ( + SELECT sum(pg_stat_get_blocks_fetched(indexrelid) - + pg_stat_get_blocks_hit(indexrelid))::bigint + AS idx_blks_read, + sum(pg_stat_get_blocks_hit(indexrelid))::bigint + AS idx_blks_hit + FROM pg_index WHERE indrelid = T.oid ) X ON true + WHERE C.relkind IN ('r', 't', 'm'); CREATE VIEW pg_statio_sys_tables AS SELECT * FROM pg_statio_all_tables diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out index ac468568a1..dd54d71098 100644 --- a/src/test/regress/expected/rules.out +++ b/src/test/regress/expected/rules.out @@ -2261,19 +2261,24 @@ pg_statio_all_tables| SELECT c.oid AS relid, c.relname, (pg_stat_get_blocks_fetched(c.oid) - pg_stat_get_blocks_hit(c.oid)) AS heap_blks_read, pg_stat_get_blocks_hit(c.oid) AS heap_blks_hit, - (sum((pg_stat_get_blocks_fetched(i.indexrelid) - pg_stat_get_blocks_hit(i.indexrelid))))::bigint AS idx_blks_read, - (sum(pg_stat_get_blocks_hit(i.indexrelid)))::bigint AS idx_blks_hit, + i.idx_blks_read, + i.idx_blks_hit, (pg_stat_get_blocks_fetched(t.oid) - pg_stat_get_blocks_hit(t.oid)) AS toast_blks_read, pg_stat_get_blocks_hit(t.oid) AS toast_blks_hit, - (pg_stat_get_blocks_fetched(x.indexrelid) - pg_stat_get_blocks_hit(x.indexrelid)) AS tidx_blks_read, - pg_stat_get_blocks_hit(x.indexrelid) AS tidx_blks_hit + x.idx_blks_read AS tidx_blks_read, + x.idx_blks_hit AS tidx_blks_hit FROM ((((pg_class c - LEFT JOIN pg_index i ON ((c.oid = i.indrelid))) LEFT JOIN pg_class t ON ((c.reltoastrelid = t.oid))) - LEFT JOIN pg_index x ON ((t.oid = x.indrelid))) LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) - WHERE (c.relkind = ANY (ARRAY['r'::"char", 't'::"char", 'm'::"char"])) - GROUP BY c.oid, n.nspname, c.relname, t.oid, x.indexrelid; + LEFT JOIN LATERAL ( SELECT (sum((pg_stat_get_blocks_fetched(pg_index.indexrelid) - pg_stat_get_blocks_hit(pg_index.indexrelid))))::bigint AS idx_blks_read, + (sum(pg_stat_get_blocks_hit(pg_index.indexrelid)))::bigint AS idx_blks_hit + FROM pg_index + WHERE (pg_index.indrelid = c.oid)) i ON (true)) + LEFT JOIN LATERAL ( SELECT (sum((pg_stat_get_blocks_fetched(pg_index.indexrelid) - pg_stat_get_blocks_hit(pg_index.indexrelid))))::bigint AS idx_blks_read, + (sum(pg_stat_get_blocks_hit(pg_index.indexrelid)))::bigint AS idx_blks_hit + FROM pg_index + WHERE (pg_index.indrelid = t.oid)) x ON (true)) + WHERE (c.relkind = ANY (ARRAY['r'::"char", 't'::"char", 'm'::"char"])); pg_statio_sys_indexes| SELECT pg_statio_all_indexes.relid, pg_statio_all_indexes.indexrelid, pg_statio_all_indexes.schemaname, ^ permalink raw reply [nested|flat] 50+ messages in thread
* Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index @ 2022-03-24 20:34 Tom Lane <[email protected]> parent: Tom Lane <[email protected]> 0 siblings, 1 reply; 50+ messages in thread From: Tom Lane @ 2022-03-24 20:34 UTC (permalink / raw) To: Andrei Zubkov <[email protected]>; +Cc: Michael Paquier <[email protected]>; PostgreSQL Hackers <[email protected]> I wrote: > After a bit of further fooling, I found that we could make that > work with LEFT JOIN LATERAL. This formulation has a different > problem, which is that if you do want most or all of the output, > computing each sub-aggregation separately is probably less > efficient than it could be. But this is probably the better way > to go unless someone has an even better idea. Hearing no better ideas, pushed. regards, tom lane ^ permalink raw reply [nested|flat] 50+ messages in thread
* Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index @ 2022-03-25 08:28 Andrei Zubkov <[email protected]> parent: Tom Lane <[email protected]> 0 siblings, 1 reply; 50+ messages in thread From: Andrei Zubkov @ 2022-03-25 08:28 UTC (permalink / raw) To: Tom Lane <[email protected]>; +Cc: Michael Paquier <[email protected]>; PostgreSQL Hackers <[email protected]> Hi Tom! On Thu, 2022-03-24 at 16:34 -0400, Tom Lane wrote: > I wrote: > > After a bit of further fooling, I found that we could make that > > work with LEFT JOIN LATERAL. This formulation has a different > > problem, which is that if you do want most or all of the output, > > computing each sub-aggregation separately is probably less > > efficient than it could be. But this is probably the better way > > to go unless someone has an even better idea. > > Hearing no better ideas, pushed. > > regards, tom lane Thank you for your attention and for the problem resolution. However I'm worry a little about possible performance issues related to monitoring solutions performing regular sampling of statistic views to find out the most intensive objects in a database. They obviously will query all rows from statistic views and their impact will only depend on the sampling frequency. Is it seems reasonable to avoid using pg_statio_all_tables view by such monitoring tools? But it seems that the only way to do so is using statistic functions directly in a sampling query. Is it seems reliable? Maybe we should think about a little bit different statio view for that? For example, a plain view for all tables (regular and TOASTs)... -- Regards, Andrei Zubkov ^ permalink raw reply [nested|flat] 50+ messages in thread
* Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index @ 2022-03-25 13:28 Tom Lane <[email protected]> parent: Andrei Zubkov <[email protected]> 0 siblings, 0 replies; 50+ messages in thread From: Tom Lane @ 2022-03-25 13:28 UTC (permalink / raw) To: Andrei Zubkov <[email protected]>; +Cc: Michael Paquier <[email protected]>; PostgreSQL Hackers <[email protected]> Andrei Zubkov <[email protected]> writes: > Thank you for your attention and for the problem resolution. However > I'm worry a little about possible performance issues related to > monitoring solutions performing regular sampling of statistic views to > find out the most intensive objects in a database. There's no actual evidence that the new formulation is meaningfully worse for such cases. Sure, it's probably *somewhat* less efficient, but that could easily be swamped by pgstat or other costs. I wouldn't care to worry about this unless some evidence is presented that we've created a big problem. regards, tom lane ^ permalink raw reply [nested|flat] 50+ messages in thread
end of thread, other threads:[~2022-03-25 13:28 UTC | newest] Thread overview: 50+ 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 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 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 03/12] 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 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 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 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 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]> 2022-03-20 22:08 Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index Tom Lane <[email protected]> 2022-03-20 22:33 ` Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index Tom Lane <[email protected]> 2022-03-24 20:34 ` Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index Tom Lane <[email protected]> 2022-03-25 08:28 ` Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index Andrei Zubkov <[email protected]> 2022-03-25 13:28 ` Re: [PATCH] pg_statio_all_tables: several rows per table due to invalid TOAST index Tom Lane <[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