mirror of
https://github.com/postgres/postgres.git
synced 2025-07-21 16:02:15 +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:
@ -30174,15 +30174,13 @@ DETAIL: Make sure pg_wal_replay_wait() isn't called within a transaction with a
|
||||
<optional>, <parameter>relpages</parameter> <type>integer</type></optional>
|
||||
<optional>, <parameter>reltuples</parameter> <type>real</type></optional>
|
||||
<optional>, <parameter>relallvisible</parameter> <type>integer</type></optional> )
|
||||
<returnvalue>boolean</returnvalue>
|
||||
<returnvalue>void</returnvalue>
|
||||
</para>
|
||||
<para>
|
||||
Updates relation-level statistics for the given relation to the
|
||||
specified values. The parameters correspond to columns in <link
|
||||
linkend="catalog-pg-class"><structname>pg_class</structname></link>. Unspecified
|
||||
or <literal>NULL</literal> values leave the setting
|
||||
unchanged. Returns <literal>true</literal> if a change was made;
|
||||
<literal>false</literal> otherwise.
|
||||
or <literal>NULL</literal> values leave the setting unchanged.
|
||||
</para>
|
||||
<para>
|
||||
Ordinarily, these statistics are collected automatically or updated
|
||||
@ -30212,12 +30210,11 @@ DETAIL: Make sure pg_wal_replay_wait() isn't called within a transaction with a
|
||||
<primary>pg_clear_relation_stats</primary>
|
||||
</indexterm>
|
||||
<function>pg_clear_relation_stats</function> ( <parameter>relation</parameter> <type>regclass</type> )
|
||||
<returnvalue>boolean</returnvalue>
|
||||
<returnvalue>void</returnvalue>
|
||||
</para>
|
||||
<para>
|
||||
Clears table-level statistics for the given relation, as though the
|
||||
table was newly created. Returns <literal>true</literal> if a change
|
||||
was made; <literal>false</literal> otherwise.
|
||||
table was newly created.
|
||||
</para>
|
||||
<para>
|
||||
The caller must have the <literal>MAINTAIN</literal> privilege on
|
||||
|
@ -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';
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -57,6 +57,6 @@
|
||||
*/
|
||||
|
||||
/* yyyymmddN */
|
||||
#define CATALOG_VERSION_NO 202410141
|
||||
#define CATALOG_VERSION_NO 202410221
|
||||
|
||||
#endif
|
||||
|
@ -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' },
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user