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

Change pg_*_relation_stats() functions to return type to void.

These functions will either raise an ERROR or run to normal
completion, so no return value is necessary.

Bump catalog version.

Author: Corey Huinker
Discussion: https://postgr.es/m/CADkLM=cBF8rnphuTyHFi3KYzB9ByDgx57HwK9Rz2yp7S+Om87w@mail.gmail.com
This commit is contained in:
Jeff Davis
2024-10-22 12:48:01 -07:00
parent 774171c4f6
commit dbe6bd4343
6 changed files with 20 additions and 21 deletions

View File

@@ -644,7 +644,7 @@ CREATE OR REPLACE FUNCTION
relpages integer DEFAULT NULL,
reltuples real DEFAULT NULL,
relallvisible integer DEFAULT NULL)
RETURNS bool
RETURNS void
LANGUAGE INTERNAL
CALLED ON NULL INPUT VOLATILE
AS 'pg_set_relation_stats';

View File

@@ -188,7 +188,8 @@ relation_statistics_update(FunctionCallInfo fcinfo, int elevel)
Datum
pg_set_relation_stats(PG_FUNCTION_ARGS)
{
PG_RETURN_BOOL(relation_statistics_update(fcinfo, ERROR));
relation_statistics_update(fcinfo, ERROR);
PG_RETURN_VOID();
}
/*
@@ -211,5 +212,6 @@ pg_clear_relation_stats(PG_FUNCTION_ARGS)
newfcinfo->args[3].value = DEFAULT_RELALLVISIBLE;
newfcinfo->args[3].isnull = false;
PG_RETURN_BOOL(relation_statistics_update(newfcinfo, ERROR));
relation_statistics_update(newfcinfo, ERROR);
PG_RETURN_VOID();
}

View File

@@ -57,6 +57,6 @@
*/
/* yyyymmddN */
#define CATALOG_VERSION_NO 202410141
#define CATALOG_VERSION_NO 202410221
#endif

View File

@@ -12345,14 +12345,14 @@
{ oid => '9944',
descr => 'set statistics on relation',
proname => 'pg_set_relation_stats', provolatile => 'v', proisstrict => 'f',
proparallel => 'u', prorettype => 'bool',
proparallel => 'u', prorettype => 'void',
proargtypes => 'regclass int4 float4 int4',
proargnames => '{relation,relpages,reltuples,relallvisible}',
prosrc => 'pg_set_relation_stats' },
{ oid => '9945',
descr => 'clear statistics on relation',
proname => 'pg_clear_relation_stats', provolatile => 'v', proisstrict => 'f',
proparallel => 'u', prorettype => 'bool',
proparallel => 'u', prorettype => 'void',
proargtypes => 'regclass',
proargnames => '{relation}',
prosrc => 'pg_clear_relation_stats' },

View File

@@ -38,7 +38,7 @@ SELECT
relallvisible => 4::integer);
pg_set_relation_stats
-----------------------
t
(1 row)
-- reltuples default
@@ -50,7 +50,7 @@ SELECT
relallvisible => 4::integer);
pg_set_relation_stats
-----------------------
t
(1 row)
-- relallvisible default
@@ -62,7 +62,7 @@ SELECT
relallvisible => NULL::integer);
pg_set_relation_stats
-----------------------
f
(1 row)
-- named arguments
@@ -74,7 +74,7 @@ SELECT
relallvisible => 4::integer);
pg_set_relation_stats
-----------------------
f
(1 row)
SELECT relpages, reltuples, relallvisible
@@ -94,7 +94,7 @@ SELECT
5::integer);
pg_set_relation_stats
-----------------------
t
(1 row)
SELECT relpages, reltuples, relallvisible
@@ -111,7 +111,7 @@ SELECT
'stats_import.test'::regclass);
pg_clear_relation_stats
-------------------------
t
(1 row)
SELECT relpages, reltuples, relallvisible
@@ -158,7 +158,7 @@ SELECT
relpages => 2::integer);
pg_set_relation_stats
-----------------------
t
(1 row)
-- nothing stops us from setting it to -1
@@ -168,7 +168,7 @@ SELECT
relpages => -1::integer);
pg_set_relation_stats
-----------------------
t
(1 row)
DROP SCHEMA stats_import CASCADE;