From 422375459d890ae9f7a7034593f03d2caf5b6cea Mon Sep 17 00:00:00 2001 From: naisila Date: Fri, 21 Nov 2025 13:37:24 +0300 Subject: [PATCH] Update some error messages in statistics Relevant PG commits: https://github.com/postgres/postgres/commit/ab16418ee https://github.com/postgres/postgres/commit/f225473cb https://github.com/postgres/postgres/commit/f9b41f3e1 --- src/test/regress/expected/pg18_0.out | 4 ++-- src/test/regress/expected/propagate_statistics.out | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/regress/expected/pg18_0.out b/src/test/regress/expected/pg18_0.out index 27d3c8d74..9146db605 100644 --- a/src/test/regress/expected/pg18_0.out +++ b/src/test/regress/expected/pg18_0.out @@ -8,12 +8,12 @@ SELECT substring(:'server_version', '\d+')::int >= 18 AS server_version_ge_18 -- behavior is same among PG versions, error message differs -- relevant PG18 commit: 3eea4dc2c7, 38883916e CREATE STATISTICS tst ON a FROM (VALUES (x)) AS foo; -ERROR: only a single relation is allowed in CREATE STATISTICS +ERROR: CREATE STATISTICS only supports relation names in the FROM clause CREATE FUNCTION tftest(int) returns table(a int, b int) as $$ SELECT $1, $1+i FROM generate_series(1,5) g(i); $$ LANGUAGE sql IMMUTABLE STRICT; CREATE STATISTICS alt_stat2 ON a FROM tftest(1); -ERROR: only a single relation is allowed in CREATE STATISTICS +ERROR: CREATE STATISTICS only supports relation names in the FROM clause DROP FUNCTION tftest; \if :server_version_ge_18 \else diff --git a/src/test/regress/expected/propagate_statistics.out b/src/test/regress/expected/propagate_statistics.out index 80e944bc8..02563c22a 100644 --- a/src/test/regress/expected/propagate_statistics.out +++ b/src/test/regress/expected/propagate_statistics.out @@ -16,7 +16,7 @@ SELECT create_distributed_table('test_stats', 'a'); (1 row) CREATE STATISTICS pg_temp.s1 (dependencies) ON a, b FROM test_stats; -ERROR: "statistics object s1" has dependency on unsupported object "schema pg_temp_xxx" +ERROR: "statistics object pg_temp_xxx.s1" has dependency on unsupported object "schema pg_temp_xxx" CREATE STATISTICS s1 (dependencies) ON a, b FROM test_stats; -- test for distributing an already existing statistics CREATE TABLE "test'stats2" (