mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-15 01:53:41 +08:00
To increase schema security we do not want to mix our own internal objects with user objects. Since chunks are created in the _timescaledb_internal schema our internal functions should live in a different dedicated schema. This patch make the necessary adjustments for the following functions: - finalize_agg_ffunc(internal,text,name,name,name[],bytea,anyelement) - finalize_agg_sfunc(internal,text,name,name,name[],bytea,anyelement) - partialize_agg(anyelement) - finalize_agg(text,name,name,name[][],bytea,anyelement)
26 lines
1.4 KiB
SQL
26 lines
1.4 KiB
SQL
-- This file and its contents are licensed under the Apache License 2.0.
|
|
-- Please see the included NOTICE for copyright information and
|
|
-- LICENSE-APACHE for a copy of the license.
|
|
|
|
CREATE OR REPLACE FUNCTION _timescaledb_functions.partialize_agg(arg ANYELEMENT)
|
|
RETURNS BYTEA AS '@MODULE_PATHNAME@', 'ts_partialize_agg' LANGUAGE C STABLE PARALLEL SAFE;
|
|
|
|
CREATE OR REPLACE FUNCTION _timescaledb_functions.finalize_agg_sfunc(
|
|
tstate internal, aggfn TEXT, inner_agg_collation_schema NAME, inner_agg_collation_name NAME, inner_agg_input_types NAME[][], inner_agg_serialized_state BYTEA, return_type_dummy_val ANYELEMENT)
|
|
RETURNS internal
|
|
AS '@MODULE_PATHNAME@', 'ts_finalize_agg_sfunc'
|
|
LANGUAGE C IMMUTABLE;
|
|
|
|
CREATE OR REPLACE FUNCTION _timescaledb_functions.finalize_agg_ffunc(
|
|
tstate internal, aggfn TEXT, inner_agg_collation_schema NAME, inner_agg_collation_name NAME, inner_agg_input_types NAME[][], inner_agg_serialized_state BYTEA, return_type_dummy_val ANYELEMENT)
|
|
RETURNS anyelement
|
|
AS '@MODULE_PATHNAME@', 'ts_finalize_agg_ffunc'
|
|
LANGUAGE C IMMUTABLE;
|
|
|
|
CREATE OR REPLACE AGGREGATE _timescaledb_functions.finalize_agg(agg_name TEXT, inner_agg_collation_schema NAME, inner_agg_collation_name NAME, inner_agg_input_types NAME[][], inner_agg_serialized_state BYTEA, return_type_dummy_val anyelement) (
|
|
SFUNC = _timescaledb_functions.finalize_agg_sfunc,
|
|
STYPE = internal,
|
|
FINALFUNC = _timescaledb_functions.finalize_agg_ffunc,
|
|
FINALFUNC_EXTRA
|
|
);
|