public inbox for [email protected]help / color / mirror / Atom feed
[PATCH 03/12] psql: Add HIDE_COMPRESSAM for regress testing 46+ messages / 2 participants [nested] [flat]
* [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing @ 2021-02-14 02:48 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ messages in thread
* [PATCH 03/12] psql: Add HIDE_COMPRESSAM for regress testing @ 2021-02-14 02:48 Justin Pryzby <[email protected]> 0 siblings, 0 replies; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ 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; 46+ 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] 46+ messages in thread
* Re: Stack overflow issue @ 2023-01-03 15:45 Sascha Kuhl <[email protected]> 0 siblings, 0 replies; 46+ messages in thread From: Sascha Kuhl @ 2023-01-03 15:45 UTC (permalink / raw) To: Егор Чиндяскин <[email protected]>; +Cc: PostgreSQL Hackers <[email protected]> Great work. Max Stack depth is memory dependent? Processor dependent? Егор Чиндяскин <[email protected]> schrieb am Mi., 24. Aug. 2022, 11:51: > Hello, I recently got a server crash (bug #17583 [1]) caused by a stack > overflow. > > Tom Lane and Richard Guo, in a discussion of this bug, suggested that > there could be more such places. > Therefore, Alexander Lakhin and I decided to deal with this issue and > Alexander developed a methodology. We processed src/backend/*/*.c with > "clang -emit-llvm ... | opt -analyze -print-calgraph" to find all the > functions that call themselves directly. I checked each of them for > features that protect against stack overflows. > We analyzed 4 catalogs: regex, tsearch, snowball and adt. > Firstly, we decided to test the regex catalog functions and found 6 of > them that lack the check_stach_depth() call. > > zaptreesubs > markst > next > nfatree > numst > repeat > > We have tried to exploit the recursion in the function zaptreesubs(): > select regexp_matches('a' || repeat(' a', 11000), '(.)(' || repeat(' \1', > 11000) || ')?'); > > ERROR: invalid regular expression: regular expression is too complex > > repeat(): > select regexp_match('abc01234xyz',repeat('a{0,2}',100001)); > > ERROR: invalid regular expression: regular expression is too complex > > numst(): > select regexp_match('abc01234xyz',repeat('(.)\1e',100001)); > > ERROR: invalid regular expression: regular expression is too complex > > markst(): > markst is called in the code after v->tree = parse(...); > it is necessary that the tree be successfully parsed, but with a nesting > level of about 100,000 this will not work - stack protection will work > during parsing and v->ntree = numst(...); is also there. > > next(): > we were able to crash the server with the following query: > (printf "SELECT regexp_match('abc', 'a"; for ((i=1;i<1000000;i++)); do > printf "(?#)"; done; printf "b')" ) | psql > > Secondly, we have tried to exploit the recursion in the adt catalog > functions and Alexander was able to crash the server with the following > query: > > regex_selectivity_sub(): > SELECT * FROM pg_proc WHERE proname ~ ('(a' || repeat('|', 200000) || > 'b)'); > > And this query: > > (n=100000; > printf "SELECT polygon '((0,0),(0,1000000))' <@ polygon > '((-200000,1000000),"; > for ((i=1;i<$n;i++)); do printf "(100000,$(( 300000 + > $i))),(-100000,$((800000 + $i))),"; done; > printf "(200000,900000),(200000,0))';" > ) | psql > > Thirdly, the snowball catalog, Alexander has tried to exploit the > recursion in the r_stem_suffix_chain_before_ki function and crashed a > server using this query: > > r_stem_suffix_chain_before_ki(): > SELECT ts_lexize('turkish_stem', repeat('lerdeki', 1000000)); > > The last one is the tsearch catalog. We have found 4 functions that didn't > have check_stach_depth() function: > > SplitToVariants > mkANode > mkSPNode > LexizeExec > > We have tried to exploit the recursion in the SplitToVariants function and > Alexander crashed a server using this: > > SplitToVariants(): > CREATE TEXT SEARCH DICTIONARY ispell (Template=ispell, > DictFile=ispell_sample,AffFile=ispell_sample); > SELECT ts_lexize('ispell', repeat('bally', 10000)); > > After trying to exploit the recursion in the LexizeExec function Alexander > made this conlusion: > > LexizeExec has two branches "ld->curDictId == InvalidOid" (usual mode) and > "ld->curDictId != InvalidOid" (multiword mode) - we start with the first > one, then make recursive call to switch to the multiword mode, but then we > return to the usual mode again. > > mkANode and mkSPNode deal with the dictionary structs, not with > user-supplied data, so we believe these functions are not vulnerable. > > [1] > https://www.postgresql.org/message-id/flat/CAMbWs499ytQiH4mLMhRxRWP-iEUz3-DSinpAD-cUCtVo_23Wtg%40mai... > ^ permalink raw reply [nested|flat] 46+ messages in thread
end of thread, other threads:[~2023-01-03 15:45 UTC | newest] Thread overview: 46+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 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 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 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 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 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]> 2021-02-14 02:48 [PATCH v24 02/10] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]> 2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]> 2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]> 2021-02-14 02:48 [PATCH v24 2/7] psql: Add HIDE_COMPRESSAM for regress testing Justin Pryzby <[email protected]> 2021-02-14 02:48 [PATCH v24 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 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 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 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 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]> 2023-01-03 15:45 Re: Stack overflow issue Sascha Kuhl <[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