From f7fa4a46c03187d01d1ac3d943aa132dad0a3a52 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Wed, 8 Feb 2023 15:42:50 +0900 Subject: [PATCH 2/2] Switch compute_query_id = regress to mean "on" and force it in pg_regress This is just a tweak to for tests with such code paths, --- src/include/nodes/queryjumble.h | 2 ++ src/backend/commands/explain.c | 2 +- src/test/regress/pg_regress.c | 3 ++- doc/src/sgml/config.sgml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/include/nodes/queryjumble.h b/src/include/nodes/queryjumble.h index 204b8f74fd..3aa7d93255 100644 --- a/src/include/nodes/queryjumble.h +++ b/src/include/nodes/queryjumble.h @@ -80,6 +80,8 @@ IsQueryIdEnabled(void) return false; if (compute_query_id == COMPUTE_QUERY_ID_ON) return true; + if (compute_query_id == COMPUTE_QUERY_ID_REGRESS) + return true; return query_id_enabled; } diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index fbbf28cf06..5aba713348 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -777,7 +777,7 @@ ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc) ExplainPrintSettings(es); /* - * COMPUTE_QUERY_ID_REGRESS means COMPUTE_QUERY_ID_AUTO, but we don't show + * COMPUTE_QUERY_ID_REGRESS means COMPUTE_QUERY_ID_ON, but we don't show * the queryid in any of the EXPLAIN plans to keep stable the results * generated by regression test suites. */ diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index 6cd5998b9d..d3aafa156c 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -1876,8 +1876,9 @@ create_database(const char *dbname) "ALTER DATABASE \"%s\" SET lc_numeric TO 'C';" "ALTER DATABASE \"%s\" SET lc_time TO 'C';" "ALTER DATABASE \"%s\" SET bytea_output TO 'hex';" + "ALTER DATABASE \"%s\" SET compute_query_id TO 'regress';" "ALTER DATABASE \"%s\" SET timezone_abbreviations TO 'Default';", - dbname, dbname, dbname, dbname, dbname, dbname); + dbname, dbname, dbname, dbname, dbname, dbname, dbname); psql_end_command(buf, "postgres"); /* diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index d190be1925..b1bb3435a5 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -8226,7 +8226,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv; on (always enabled), auto, which lets modules such as automatically enable it, and regress which - has the same effect as auto, except that the + has the same effect as on, except that the query identifier is not shown in the EXPLAIN output in order to facilitate automated regression testing. The default is auto. -- 2.39.1