1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-19 17:02:53 +03:00

Message style improvements

An improvement pass over the new stats import functionality.
This commit is contained in:
Peter Eisentraut
2025-08-27 21:17:58 +02:00
parent 5865150b6d
commit 80f1106132
4 changed files with 52 additions and 49 deletions

View File

@@ -50,26 +50,26 @@ SELECT pg_clear_relation_stats('stats_import', 'test');
SELECT pg_catalog.pg_restore_relation_stats(
'relname', 'test',
'relpages', 17::integer);
ERROR: "schemaname" cannot be NULL
ERROR: argument "schemaname" must not be null
-- error: relname missing
SELECT pg_catalog.pg_restore_relation_stats(
'schemaname', 'stats_import',
'relpages', 17::integer);
ERROR: "relname" cannot be NULL
ERROR: argument "relname" must not be null
--- error: schemaname is wrong type
SELECT pg_catalog.pg_restore_relation_stats(
'schemaname', 3.6::float,
'relname', 'test',
'relpages', 17::integer);
WARNING: argument "schemaname" has type "double precision", expected type "text"
ERROR: "schemaname" cannot be NULL
WARNING: argument "schemaname" has type double precision, expected type text
ERROR: argument "schemaname" must not be null
--- error: relname is wrong type
SELECT pg_catalog.pg_restore_relation_stats(
'schemaname', 'stats_import',
'relname', 0::oid,
'relpages', 17::integer);
WARNING: argument "relname" has type "oid", expected type "text"
ERROR: "relname" cannot be NULL
WARNING: argument "relname" has type oid, expected type text
ERROR: argument "relname" must not be null
-- error: relation not found
SELECT pg_catalog.pg_restore_relation_stats(
'schemaname', 'stats_import',
@@ -88,7 +88,7 @@ SELECT pg_restore_relation_stats(
'schemaname', 'stats_import',
'relname', 'test',
NULL, '17'::integer);
ERROR: name at variadic position 5 is NULL
ERROR: name at variadic position 5 is null
-- starting stats
SELECT relpages, reltuples, relallvisible, relallfrozen
FROM pg_class
@@ -286,7 +286,7 @@ SELECT pg_restore_relation_stats(
'reltuples', 400.0::real,
'relallvisible', 4::integer,
'relallfrozen', 3::integer);
WARNING: argument "relpages" has type "text", expected type "integer"
WARNING: argument "relpages" has type text, expected type integer
pg_restore_relation_stats
---------------------------
f
@@ -358,7 +358,7 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'attname', 'id',
'inherited', false::boolean,
'null_frac', 0.1::real);
ERROR: "schemaname" cannot be NULL
ERROR: argument "schemaname" must not be null
-- error: schema does not exist
SELECT pg_catalog.pg_restore_attribute_stats(
'schemaname', 'nope',
@@ -373,7 +373,7 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'attname', 'id',
'inherited', false::boolean,
'null_frac', 0.1::real);
ERROR: "relname" cannot be NULL
ERROR: argument "relname" must not be null
-- error: relname does not exist
SELECT pg_catalog.pg_restore_attribute_stats(
'schemaname', 'stats_import',
@@ -389,7 +389,7 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'attname', 'id',
'inherited', false::boolean,
'null_frac', 0.1::real);
ERROR: "relname" cannot be NULL
ERROR: argument "relname" must not be null
-- error: NULL attname
SELECT pg_catalog.pg_restore_attribute_stats(
'schemaname', 'stats_import',
@@ -397,7 +397,7 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'attname', NULL,
'inherited', false::boolean,
'null_frac', 0.1::real);
ERROR: must specify either attname or attnum
ERROR: must specify either "attname" or "attnum"
-- error: attname doesn't exist
SELECT pg_catalog.pg_restore_attribute_stats(
'schemaname', 'stats_import',
@@ -416,14 +416,14 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'attnum', 1::smallint,
'inherited', false::boolean,
'null_frac', 0.1::real);
ERROR: cannot specify both attname and attnum
ERROR: cannot specify both "attname" and "attnum"
-- error: neither attname nor attnum
SELECT pg_catalog.pg_restore_attribute_stats(
'schemaname', 'stats_import',
'relname', 'test',
'inherited', false::boolean,
'null_frac', 0.1::real);
ERROR: must specify either attname or attnum
ERROR: must specify either "attname" or "attnum"
-- error: attribute is system column
SELECT pg_catalog.pg_restore_attribute_stats(
'schemaname', 'stats_import',
@@ -439,7 +439,7 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'attname', 'id',
'inherited', NULL::boolean,
'null_frac', 0.1::real);
ERROR: "inherited" cannot be NULL
ERROR: argument "inherited" must not be null
-- ok: just the fixed values, with version, no stakinds
SELECT pg_catalog.pg_restore_attribute_stats(
'schemaname', 'stats_import',
@@ -527,7 +527,7 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'null_frac', 0.21::real,
'most_common_freqs', '{0.1,0.2,0.3}'::real[]
);
WARNING: "most_common_vals" must be specified when "most_common_freqs" is specified
WARNING: argument "most_common_vals" must be specified when argument "most_common_freqs" is specified
pg_restore_attribute_stats
----------------------------
f
@@ -553,7 +553,7 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'null_frac', 0.21::real,
'most_common_vals', '{1,2,3}'::text
);
WARNING: "most_common_freqs" must be specified when "most_common_vals" is specified
WARNING: argument "most_common_freqs" must be specified when argument "most_common_vals" is specified
pg_restore_attribute_stats
----------------------------
f
@@ -580,8 +580,8 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'most_common_vals', '{2,1,3}'::text,
'most_common_freqs', '{0.2,0.1}'::double precision[]
);
WARNING: argument "most_common_freqs" has type "double precision[]", expected type "real[]"
WARNING: "most_common_freqs" must be specified when "most_common_vals" is specified
WARNING: argument "most_common_freqs" has type double precision[], expected type real[]
WARNING: argument "most_common_freqs" must be specified when argument "most_common_vals" is specified
pg_restore_attribute_stats
----------------------------
f
@@ -659,7 +659,7 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'null_frac', 0.24::real,
'histogram_bounds', '{1,NULL,3,4}'::text
);
WARNING: "histogram_bounds" array cannot contain NULL values
WARNING: "histogram_bounds" array must not contain null values
pg_restore_attribute_stats
----------------------------
f
@@ -709,7 +709,7 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'null_frac', 0.25::real,
'elem_count_histogram', '{1,1,NULL,1,1,1,1,1}'::real[]
);
WARNING: "elem_count_histogram" array cannot contain NULL values
WARNING: argument "elem_count_histogram" array must not contain null values
pg_restore_attribute_stats
----------------------------
f
@@ -761,7 +761,7 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'range_empty_frac', 0.5::real,
'range_length_histogram', '{399,499,Infinity}'::text
);
WARNING: attribute "id" is not a range type
WARNING: column "id" is not a range type
DETAIL: Cannot set STATISTIC_KIND_RANGE_LENGTH_HISTOGRAM or STATISTIC_KIND_BOUNDS_HISTOGRAM.
pg_restore_attribute_stats
----------------------------
@@ -788,7 +788,7 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'null_frac', 0.28::real,
'range_length_histogram', '{399,499,Infinity}'::text
);
WARNING: "range_empty_frac" must be specified when "range_length_histogram" is specified
WARNING: argument "range_empty_frac" must be specified when argument "range_length_histogram" is specified
pg_restore_attribute_stats
----------------------------
f
@@ -814,7 +814,7 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'null_frac', 0.29::real,
'range_empty_frac', 0.5::real
);
WARNING: "range_length_histogram" must be specified when "range_empty_frac" is specified
WARNING: argument "range_length_histogram" must be specified when argument "range_empty_frac" is specified
pg_restore_attribute_stats
----------------------------
f
@@ -865,7 +865,7 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'null_frac', 0.31::real,
'range_bounds_histogram', '{"[-1,1)","[0,4)","[1,4)","[1,100)"}'::text
);
WARNING: attribute "id" is not a range type
WARNING: column "id" is not a range type
DETAIL: Cannot set STATISTIC_KIND_RANGE_LENGTH_HISTOGRAM or STATISTIC_KIND_BOUNDS_HISTOGRAM.
pg_restore_attribute_stats
----------------------------
@@ -917,7 +917,7 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'most_common_elems', '{3,1}'::text,
'most_common_elem_freqs', '{0.3,0.2,0.2,0.3,0.0}'::real[]
);
WARNING: unable to determine element type of attribute "arange"
WARNING: could not determine element type of column "arange"
DETAIL: Cannot set STATISTIC_KIND_MCELEM or STATISTIC_KIND_DECHIST.
pg_restore_attribute_stats
----------------------------
@@ -945,7 +945,7 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'most_common_elems', '{1,3}'::text,
'most_common_elem_freqs', '{0.3,0.2,0.2,0.3,0.0}'::real[]
);
WARNING: unable to determine element type of attribute "id"
WARNING: could not determine element type of column "id"
DETAIL: Cannot set STATISTIC_KIND_MCELEM or STATISTIC_KIND_DECHIST.
pg_restore_attribute_stats
----------------------------
@@ -972,7 +972,7 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'null_frac', 0.34::real,
'most_common_elems', '{one,two}'::text
);
WARNING: "most_common_elem_freqs" must be specified when "most_common_elems" is specified
WARNING: argument "most_common_elem_freqs" must be specified when argument "most_common_elems" is specified
pg_restore_attribute_stats
----------------------------
f
@@ -998,7 +998,7 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'null_frac', 0.35::real,
'most_common_elem_freqs', '{0.3,0.2,0.2,0.3}'::real[]
);
WARNING: "most_common_elems" must be specified when "most_common_elem_freqs" is specified
WARNING: argument "most_common_elems" must be specified when argument "most_common_elem_freqs" is specified
pg_restore_attribute_stats
----------------------------
f
@@ -1049,7 +1049,7 @@ SELECT pg_catalog.pg_restore_attribute_stats(
'null_frac', 0.36::real,
'elem_count_histogram', '{1,1,1,1,1,1,1,1,1,1}'::real[]
);
WARNING: unable to determine element type of attribute "id"
WARNING: could not determine element type of column "id"
DETAIL: Cannot set STATISTIC_KIND_MCELEM or STATISTIC_KIND_DECHIST.
pg_restore_attribute_stats
----------------------------