naisila 2025-11-21 13:37:24 +03:00
parent 6f055c0f96
commit 422375459d
2 changed files with 3 additions and 3 deletions

View File

@ -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 -- behavior is same among PG versions, error message differs
-- relevant PG18 commit: 3eea4dc2c7, 38883916e -- relevant PG18 commit: 3eea4dc2c7, 38883916e
CREATE STATISTICS tst ON a FROM (VALUES (x)) AS foo; 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 $$ CREATE FUNCTION tftest(int) returns table(a int, b int) as $$
SELECT $1, $1+i FROM generate_series(1,5) g(i); SELECT $1, $1+i FROM generate_series(1,5) g(i);
$$ LANGUAGE sql IMMUTABLE STRICT; $$ LANGUAGE sql IMMUTABLE STRICT;
CREATE STATISTICS alt_stat2 ON a FROM tftest(1); 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; DROP FUNCTION tftest;
\if :server_version_ge_18 \if :server_version_ge_18
\else \else

View File

@ -16,7 +16,7 @@ SELECT create_distributed_table('test_stats', 'a');
(1 row) (1 row)
CREATE STATISTICS pg_temp.s1 (dependencies) ON a, b FROM test_stats; 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; CREATE STATISTICS s1 (dependencies) ON a, b FROM test_stats;
-- test for distributing an already existing statistics -- test for distributing an already existing statistics
CREATE TABLE "test'stats2" ( CREATE TABLE "test'stats2" (