mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-16 02:23:49 +08:00
Prefix public C functions with ts_
We've decided to adopt the ts_ prefix on all exported C functions in order to avoid having symbol conflicts with future postgres functions. We've already started using this prefix on new functions and this commit adds the prefix to to the old functions.
This commit is contained in:
parent
39510c3c5a
commit
974788516a
@ -1,34 +1,34 @@
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.first_sfunc(internal, anyelement, "any")
|
||||
RETURNS internal
|
||||
AS '@MODULE_PATHNAME@', 'first_sfunc'
|
||||
AS '@MODULE_PATHNAME@', 'ts_first_sfunc'
|
||||
LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.first_combinefunc(internal, internal)
|
||||
RETURNS internal
|
||||
AS '@MODULE_PATHNAME@', 'first_combinefunc'
|
||||
AS '@MODULE_PATHNAME@', 'ts_first_combinefunc'
|
||||
LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.last_sfunc(internal, anyelement, "any")
|
||||
RETURNS internal
|
||||
AS '@MODULE_PATHNAME@', 'last_sfunc'
|
||||
AS '@MODULE_PATHNAME@', 'ts_last_sfunc'
|
||||
LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.last_combinefunc(internal, internal)
|
||||
RETURNS internal
|
||||
AS '@MODULE_PATHNAME@', 'last_combinefunc'
|
||||
AS '@MODULE_PATHNAME@', 'ts_last_combinefunc'
|
||||
LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.bookend_finalfunc(internal, anyelement, "any")
|
||||
RETURNS anyelement
|
||||
AS '@MODULE_PATHNAME@', 'bookend_finalfunc'
|
||||
AS '@MODULE_PATHNAME@', 'ts_bookend_finalfunc'
|
||||
LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.bookend_serializefunc(internal)
|
||||
RETURNS bytea
|
||||
AS '@MODULE_PATHNAME@', 'bookend_serializefunc'
|
||||
AS '@MODULE_PATHNAME@', 'ts_bookend_serializefunc'
|
||||
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.bookend_deserializefunc(bytea, internal)
|
||||
RETURNS internal
|
||||
AS '@MODULE_PATHNAME@', 'bookend_deserializefunc'
|
||||
AS '@MODULE_PATHNAME@', 'ts_bookend_deserializefunc'
|
||||
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
@ -3,14 +3,14 @@ CREATE OR REPLACE FUNCTION _timescaledb_internal.dimension_calculate_default_ran
|
||||
interval_length BIGINT,
|
||||
OUT range_start BIGINT,
|
||||
OUT range_end BIGINT)
|
||||
AS '@MODULE_PATHNAME@', 'dimension_calculate_open_range_default' LANGUAGE C STABLE;
|
||||
AS '@MODULE_PATHNAME@', 'ts_dimension_calculate_open_range_default' LANGUAGE C STABLE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.dimension_calculate_default_range_closed(
|
||||
dimension_value BIGINT,
|
||||
num_slices SMALLINT,
|
||||
OUT range_start BIGINT,
|
||||
OUT range_end BIGINT)
|
||||
AS '@MODULE_PATHNAME@', 'dimension_calculate_closed_range_default' LANGUAGE C STABLE;
|
||||
AS '@MODULE_PATHNAME@', 'ts_dimension_calculate_closed_range_default' LANGUAGE C STABLE;
|
||||
|
||||
-- Built-in function for calculating the next chunk interval when
|
||||
-- using adaptive chunking. The function can be replaced by a
|
||||
@ -29,4 +29,4 @@ CREATE OR REPLACE FUNCTION _timescaledb_internal.calculate_chunk_interval(
|
||||
dimension_id INTEGER,
|
||||
dimension_coord BIGINT,
|
||||
chunk_target_size BIGINT
|
||||
) RETURNS BIGINT AS '@MODULE_PATHNAME@', 'calculate_chunk_interval' LANGUAGE C;
|
||||
) RETURNS BIGINT AS '@MODULE_PATHNAME@', 'ts_calculate_chunk_interval' LANGUAGE C;
|
||||
|
@ -29,7 +29,7 @@ CREATE OR REPLACE FUNCTION create_hypertable(
|
||||
migrate_data BOOLEAN = FALSE,
|
||||
chunk_target_size TEXT = NULL,
|
||||
chunk_sizing_func REGPROC = '_timescaledb_internal.calculate_chunk_interval'::regproc
|
||||
) RETURNS VOID AS '@MODULE_PATHNAME@', 'hypertable_create' LANGUAGE C VOLATILE;
|
||||
) RETURNS VOID AS '@MODULE_PATHNAME@', 'ts_hypertable_create' LANGUAGE C VOLATILE;
|
||||
|
||||
-- Set adaptive chunking. To disable, set chunk_target_size => 'off'.
|
||||
CREATE OR REPLACE FUNCTION set_adaptive_chunking(
|
||||
@ -37,7 +37,7 @@ CREATE OR REPLACE FUNCTION set_adaptive_chunking(
|
||||
chunk_target_size TEXT,
|
||||
INOUT chunk_sizing_func REGPROC = '_timescaledb_internal.calculate_chunk_interval'::regproc,
|
||||
OUT chunk_target_size BIGINT
|
||||
) RETURNS RECORD AS '@MODULE_PATHNAME@', 'chunk_adaptive_set' LANGUAGE C VOLATILE;
|
||||
) RETURNS RECORD AS '@MODULE_PATHNAME@', 'ts_chunk_adaptive_set' LANGUAGE C VOLATILE;
|
||||
|
||||
-- Update chunk_time_interval for a hypertable.
|
||||
--
|
||||
@ -51,13 +51,13 @@ CREATE OR REPLACE FUNCTION set_chunk_time_interval(
|
||||
main_table REGCLASS,
|
||||
chunk_time_interval ANYELEMENT,
|
||||
dimension_name NAME = NULL
|
||||
) RETURNS VOID AS '@MODULE_PATHNAME@', 'dimension_set_interval' LANGUAGE C VOLATILE;
|
||||
) RETURNS VOID AS '@MODULE_PATHNAME@', 'ts_dimension_set_interval' LANGUAGE C VOLATILE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION set_number_partitions(
|
||||
main_table REGCLASS,
|
||||
number_partitions INTEGER,
|
||||
dimension_name NAME = NULL
|
||||
) RETURNS VOID AS '@MODULE_PATHNAME@', 'dimension_set_num_slices' LANGUAGE C VOLATILE;
|
||||
) RETURNS VOID AS '@MODULE_PATHNAME@', 'ts_dimension_set_num_slices' LANGUAGE C VOLATILE;
|
||||
|
||||
-- Drop chunks that are older than a timestamp.
|
||||
CREATE OR REPLACE FUNCTION drop_chunks(
|
||||
@ -139,24 +139,24 @@ CREATE OR REPLACE FUNCTION add_dimension(
|
||||
partitioning_func REGPROC = NULL,
|
||||
if_not_exists BOOLEAN = FALSE
|
||||
) RETURNS VOID
|
||||
AS '@MODULE_PATHNAME@', 'dimension_add' LANGUAGE C VOLATILE;
|
||||
AS '@MODULE_PATHNAME@', 'ts_dimension_add' LANGUAGE C VOLATILE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION attach_tablespace(
|
||||
tablespace NAME,
|
||||
hypertable REGCLASS,
|
||||
if_not_attached BOOLEAN = false
|
||||
) RETURNS VOID
|
||||
AS '@MODULE_PATHNAME@', 'tablespace_attach' LANGUAGE C VOLATILE;
|
||||
AS '@MODULE_PATHNAME@', 'ts_tablespace_attach' LANGUAGE C VOLATILE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION detach_tablespace(
|
||||
tablespace NAME,
|
||||
hypertable REGCLASS = NULL,
|
||||
if_attached BOOLEAN = false
|
||||
) RETURNS INTEGER
|
||||
AS '@MODULE_PATHNAME@', 'tablespace_detach' LANGUAGE C VOLATILE;
|
||||
AS '@MODULE_PATHNAME@', 'ts_tablespace_detach' LANGUAGE C VOLATILE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION detach_tablespaces(hypertable REGCLASS) RETURNS INTEGER
|
||||
AS '@MODULE_PATHNAME@', 'tablespace_detach_all_from_hypertable' LANGUAGE C VOLATILE;
|
||||
AS '@MODULE_PATHNAME@', 'ts_tablespace_detach_all_from_hypertable' LANGUAGE C VOLATILE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION show_tablespaces(hypertable REGCLASS) RETURNS SETOF NAME
|
||||
AS '@MODULE_PATHNAME@', 'tablespace_show' LANGUAGE C VOLATILE STRICT;
|
||||
AS '@MODULE_PATHNAME@', 'ts_tablespace_show' LANGUAGE C VOLATILE STRICT;
|
||||
|
@ -114,7 +114,7 @@ $BODY$;
|
||||
|
||||
--documentation of these function located in chunk_index.h
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.chunk_index_clone(chunk_index_oid OID) RETURNS OID
|
||||
AS '@MODULE_PATHNAME@', 'chunk_index_clone' LANGUAGE C VOLATILE STRICT;
|
||||
AS '@MODULE_PATHNAME@', 'ts_chunk_index_clone' LANGUAGE C VOLATILE STRICT;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.chunk_index_replace(chunk_index_oid_old OID, chunk_index_oid_new OID) RETURNS VOID
|
||||
AS '@MODULE_PATHNAME@', 'chunk_index_replace' LANGUAGE C VOLATILE STRICT;
|
||||
AS '@MODULE_PATHNAME@', 'ts_chunk_index_replace' LANGUAGE C VOLATILE STRICT;
|
||||
|
@ -1,7 +1,7 @@
|
||||
DROP EVENT TRIGGER IF EXISTS timescaledb_ddl_command_end;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.process_ddl_event() RETURNS event_trigger
|
||||
AS '@MODULE_PATHNAME@', 'timescaledb_process_ddl_event' LANGUAGE C;
|
||||
AS '@MODULE_PATHNAME@', 'ts_timescaledb_process_ddl_event' LANGUAGE C;
|
||||
|
||||
--EVENT TRIGGER MUST exclude the ALTER EXTENSION tag.
|
||||
CREATE EVENT TRIGGER timescaledb_ddl_command_end ON ddl_command_end
|
||||
|
@ -1,24 +1,24 @@
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.hist_sfunc (state INTERNAL, val DOUBLE PRECISION, MIN DOUBLE PRECISION, MAX DOUBLE PRECISION, nbuckets INTEGER)
|
||||
RETURNS INTERNAL
|
||||
AS '@MODULE_PATHNAME@', 'hist_sfunc'
|
||||
AS '@MODULE_PATHNAME@', 'ts_hist_sfunc'
|
||||
LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.hist_combinefunc(state1 INTERNAL, state2 INTERNAL)
|
||||
RETURNS INTERNAL
|
||||
AS '@MODULE_PATHNAME@', 'hist_combinefunc'
|
||||
AS '@MODULE_PATHNAME@', 'ts_hist_combinefunc'
|
||||
LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.hist_serializefunc(INTERNAL)
|
||||
RETURNS bytea
|
||||
AS '@MODULE_PATHNAME@', 'hist_serializefunc'
|
||||
AS '@MODULE_PATHNAME@', 'ts_hist_serializefunc'
|
||||
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.hist_deserializefunc(bytea, INTERNAL)
|
||||
RETURNS INTERNAL
|
||||
AS '@MODULE_PATHNAME@', 'hist_deserializefunc'
|
||||
AS '@MODULE_PATHNAME@', 'ts_hist_deserializefunc'
|
||||
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.hist_finalfunc(state INTERNAL, val DOUBLE PRECISION, MIN DOUBLE PRECISION, MAX DOUBLE PRECISION, nbuckets INTEGER)
|
||||
RETURNS INTEGER[]
|
||||
AS '@MODULE_PATHNAME@', 'hist_finalfunc'
|
||||
AS '@MODULE_PATHNAME@', 'ts_hist_finalfunc'
|
||||
LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
|
@ -1,3 +1,3 @@
|
||||
-- Trigger that blocks INSERTs on the hypertable's root table
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.insert_blocker() RETURNS trigger
|
||||
AS '@MODULE_PATHNAME@', 'hypertable_insert_blocker' LANGUAGE C;
|
||||
AS '@MODULE_PATHNAME@', 'ts_hypertable_insert_blocker' LANGUAGE C;
|
||||
|
@ -1,9 +1,9 @@
|
||||
-- Deprecated partition hash function
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.get_partition_for_key(val anyelement)
|
||||
RETURNS int
|
||||
AS '@MODULE_PATHNAME@', 'get_partition_for_key' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '@MODULE_PATHNAME@', 'ts_get_partition_for_key' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.get_partition_hash(val anyelement)
|
||||
RETURNS int
|
||||
AS '@MODULE_PATHNAME@', 'get_partition_hash' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '@MODULE_PATHNAME@', 'ts_get_partition_hash' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
-- time_bucket returns the left edge of the bucket where ts falls into.
|
||||
-- Buckets span an interval of time equal to the bucket_width and are aligned with the epoch.
|
||||
CREATE OR REPLACE FUNCTION time_bucket(bucket_width INTERVAL, ts TIMESTAMP) RETURNS TIMESTAMP
|
||||
AS '@MODULE_PATHNAME@', 'timestamp_bucket' LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
AS '@MODULE_PATHNAME@', 'ts_timestamp_bucket' LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
|
||||
-- bucketing of timestamptz happens at UTC time
|
||||
CREATE OR REPLACE FUNCTION time_bucket(bucket_width INTERVAL, ts TIMESTAMPTZ) RETURNS TIMESTAMPTZ
|
||||
AS '@MODULE_PATHNAME@', 'timestamptz_bucket' LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
AS '@MODULE_PATHNAME@', 'ts_timestamptz_bucket' LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
|
||||
--bucketing on date should not do any timezone conversion
|
||||
CREATE OR REPLACE FUNCTION time_bucket(bucket_width INTERVAL, ts DATE) RETURNS DATE
|
||||
AS '@MODULE_PATHNAME@', 'date_bucket' LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
AS '@MODULE_PATHNAME@', 'ts_date_bucket' LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION time_bucket(bucket_width SMALLINT, ts SMALLINT) RETURNS SMALLINT
|
||||
AS '@MODULE_PATHNAME@', 'ts_int16_bucket' LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
|
@ -3,7 +3,7 @@ CREATE OR REPLACE FUNCTION _timescaledb_internal.calculate_chunk_interval(
|
||||
dimension_id INTEGER,
|
||||
dimension_coord BIGINT,
|
||||
chunk_target_size BIGINT
|
||||
) RETURNS BIGINT AS '@MODULE_PATHNAME@', 'calculate_chunk_interval' LANGUAGE C;
|
||||
) RETURNS BIGINT AS '@MODULE_PATHNAME@', 'ts_calculate_chunk_interval' LANGUAGE C;
|
||||
|
||||
ALTER TABLE _timescaledb_catalog.hypertable ADD COLUMN chunk_sizing_func_schema NAME;
|
||||
ALTER TABLE _timescaledb_catalog.hypertable ADD COLUMN chunk_sizing_func_name NAME;
|
||||
|
@ -1,10 +1,10 @@
|
||||
-- Trigger that blocks INSERTs on the hypertable's root table
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.insert_blocker() RETURNS trigger
|
||||
AS '@MODULE_PATHNAME@', 'hypertable_insert_blocker' LANGUAGE C;
|
||||
AS '@MODULE_PATHNAME@', 'ts_hypertable_insert_blocker' LANGUAGE C;
|
||||
|
||||
-- Drop all pre-0.11.1 insert_blockers from hypertables and add the new, visible trigger
|
||||
CREATE FUNCTION _timescaledb_internal.insert_blocker_trigger_add(relid REGCLASS) RETURNS OID
|
||||
AS '@MODULE_PATHNAME@', 'hypertable_insert_blocker_trigger_add' LANGUAGE C VOLATILE STRICT;
|
||||
AS '@MODULE_PATHNAME@', 'ts_hypertable_insert_blocker_trigger_add' LANGUAGE C VOLATILE STRICT;
|
||||
|
||||
SELECT _timescaledb_internal.insert_blocker_trigger_add(h.relid)
|
||||
FROM (SELECT format('%I.%I', schema_name, table_name)::regclass AS relid FROM _timescaledb_catalog.hypertable) AS h;
|
||||
|
@ -250,27 +250,27 @@ DROP FUNCTION IF EXISTS _timescaledb_internal.need_chunk_trigger(int, oid);
|
||||
-- Adding this in the update script because aggregates.sql is not rerun in case of an update
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.hist_sfunc (state INTERNAL, val DOUBLE PRECISION, MIN DOUBLE PRECISION, MAX DOUBLE PRECISION, nbuckets INTEGER)
|
||||
RETURNS INTERNAL
|
||||
AS '@MODULE_PATHNAME@', 'hist_sfunc'
|
||||
AS '@MODULE_PATHNAME@', 'ts_hist_sfunc'
|
||||
LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.hist_combinefunc(state1 INTERNAL, state2 INTERNAL)
|
||||
RETURNS INTERNAL
|
||||
AS '@MODULE_PATHNAME@', 'hist_combinefunc'
|
||||
AS '@MODULE_PATHNAME@', 'ts_hist_combinefunc'
|
||||
LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.hist_serializefunc(INTERNAL)
|
||||
RETURNS bytea
|
||||
AS '@MODULE_PATHNAME@', 'hist_serializefunc'
|
||||
AS '@MODULE_PATHNAME@', 'ts_hist_serializefunc'
|
||||
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.hist_deserializefunc(bytea, INTERNAL)
|
||||
RETURNS INTERNAL
|
||||
AS '@MODULE_PATHNAME@', 'hist_deserializefunc'
|
||||
AS '@MODULE_PATHNAME@', 'ts_hist_deserializefunc'
|
||||
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.hist_finalfunc(state INTERNAL, val DOUBLE PRECISION, MIN DOUBLE PRECISION, MAX DOUBLE PRECISION, nbuckets INTEGER)
|
||||
RETURNS INTEGER[]
|
||||
AS '@MODULE_PATHNAME@', 'hist_finalfunc'
|
||||
AS '@MODULE_PATHNAME@', 'ts_hist_finalfunc'
|
||||
LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
|
||||
-- This aggregate partitions the dataset into a specified number of buckets (nbuckets) ranging
|
||||
|
@ -62,10 +62,10 @@ $BODY$;
|
||||
SELECT _timescaledb_internal.set_time_columns_not_null();
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.to_unix_microseconds(ts TIMESTAMPTZ) RETURNS BIGINT
|
||||
AS '@MODULE_PATHNAME@', 'pg_timestamp_to_unix_microseconds' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '@MODULE_PATHNAME@', 'ts_pg_timestamp_to_unix_microseconds' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.to_timestamp(unixtime_us BIGINT) RETURNS TIMESTAMPTZ
|
||||
AS '@MODULE_PATHNAME@', 'pg_unix_microseconds_to_timestamp' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '@MODULE_PATHNAME@', 'ts_pg_unix_microseconds_to_timestamp' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.dimension_is_finite(
|
||||
val BIGINT
|
||||
@ -179,7 +179,7 @@ BEGIN
|
||||
DROP FUNCTION IF EXISTS _timescaledb_internal.get_partition_for_key(text);
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.get_partition_for_key(val anyelement)
|
||||
RETURNS int
|
||||
AS '@MODULE_PATHNAME@', 'get_partition_for_key' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '@MODULE_PATHNAME@', 'ts_get_partition_for_key' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
||||
FOR chunk_constraint_row IN
|
||||
SELECT cc.*
|
||||
|
@ -1,15 +1,15 @@
|
||||
-- This file contains utilities for time conversion.
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.to_microseconds(ts TIMESTAMPTZ) RETURNS BIGINT
|
||||
AS '@MODULE_PATHNAME@', 'pg_timestamp_to_microseconds' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '@MODULE_PATHNAME@', 'ts_pg_timestamp_to_microseconds' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.to_unix_microseconds(ts TIMESTAMPTZ) RETURNS BIGINT
|
||||
AS '@MODULE_PATHNAME@', 'pg_timestamp_to_unix_microseconds' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '@MODULE_PATHNAME@', 'ts_pg_timestamp_to_unix_microseconds' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.to_timestamp(unixtime_us BIGINT) RETURNS TIMESTAMPTZ
|
||||
AS '@MODULE_PATHNAME@', 'pg_unix_microseconds_to_timestamp' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '@MODULE_PATHNAME@', 'ts_pg_unix_microseconds_to_timestamp' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.to_timestamp_pg(postgres_us BIGINT) RETURNS TIMESTAMPTZ
|
||||
AS '@MODULE_PATHNAME@', 'pg_microseconds_to_timestamp' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '@MODULE_PATHNAME@', 'ts_pg_microseconds_to_timestamp' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
||||
-- Time can be represented in a hypertable as an int* (bigint/integer/smallint) or as a timestamp type (
|
||||
-- with or without timezones). In or metatables and other internal systems all time values are stored as bigint.
|
||||
@ -56,4 +56,4 @@ $BODY$
|
||||
$BODY$;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.time_to_internal(time_element anyelement) RETURNS BIGINT
|
||||
AS '@MODULE_PATHNAME@', 'time_to_internal' LANGUAGE C IMMUTABLE PARALLEL SAFE STRICT;
|
||||
AS '@MODULE_PATHNAME@', 'ts_time_to_internal' LANGUAGE C IMMUTABLE PARALLEL SAFE STRICT;
|
||||
|
@ -1,5 +1,5 @@
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.get_git_commit() RETURNS TEXT
|
||||
AS '@MODULE_PATHNAME@', 'get_git_commit' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '@MODULE_PATHNAME@', 'ts_get_git_commit' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.get_os_info()
|
||||
RETURNS TABLE(sysname TEXT, version TEXT, release TEXT)
|
||||
|
@ -17,13 +17,13 @@
|
||||
* SELECT first(metric, time), last(metric, time) FROM metric GROUP BY hostname.
|
||||
*/
|
||||
|
||||
TS_FUNCTION_INFO_V1(first_sfunc);
|
||||
TS_FUNCTION_INFO_V1(first_combinefunc);
|
||||
TS_FUNCTION_INFO_V1(last_sfunc);
|
||||
TS_FUNCTION_INFO_V1(last_combinefunc);
|
||||
TS_FUNCTION_INFO_V1(bookend_finalfunc);
|
||||
TS_FUNCTION_INFO_V1(bookend_serializefunc);
|
||||
TS_FUNCTION_INFO_V1(bookend_deserializefunc);
|
||||
TS_FUNCTION_INFO_V1(ts_first_sfunc);
|
||||
TS_FUNCTION_INFO_V1(ts_first_combinefunc);
|
||||
TS_FUNCTION_INFO_V1(ts_last_sfunc);
|
||||
TS_FUNCTION_INFO_V1(ts_last_combinefunc);
|
||||
TS_FUNCTION_INFO_V1(ts_bookend_finalfunc);
|
||||
TS_FUNCTION_INFO_V1(ts_bookend_serializefunc);
|
||||
TS_FUNCTION_INFO_V1(ts_bookend_deserializefunc);
|
||||
|
||||
/* A PolyDatum represents a polymorphic datum */
|
||||
typedef struct PolyDatum
|
||||
@ -286,7 +286,7 @@ transcache_get(FunctionCallInfo fcinfo)
|
||||
}
|
||||
|
||||
/*
|
||||
* bookend_sfunc - internal function called be last_sfunc and first_sfunc;
|
||||
* bookend_sfunc - internal function called be ts_last_sfunc and ts_first_sfunc;
|
||||
*/
|
||||
static inline Datum
|
||||
bookend_sfunc(MemoryContext aggcontext, InternalCmpAggStore *state, PolyDatum value, PolyDatum cmp, char *opname, FunctionCallInfo fcinfo)
|
||||
@ -319,7 +319,7 @@ bookend_sfunc(MemoryContext aggcontext, InternalCmpAggStore *state, PolyDatum va
|
||||
PG_RETURN_POINTER(state);
|
||||
}
|
||||
|
||||
/* bookend_combinefunc - internal function called be last_combinefunc and first_combinefunc;
|
||||
/* bookend_combinefunc - internal function called be ts_last_combinefunc and ts_first_combinefunc;
|
||||
* fmgr args are: (internal internal_state, internal2 internal_state)
|
||||
*/
|
||||
static inline Datum
|
||||
@ -372,7 +372,7 @@ bookend_combinefunc(MemoryContext aggcontext, InternalCmpAggStore *state1, Inter
|
||||
|
||||
/* first(internal internal_state, anyelement value, "any" comparison_element) */
|
||||
Datum
|
||||
first_sfunc(PG_FUNCTION_ARGS)
|
||||
ts_first_sfunc(PG_FUNCTION_ARGS)
|
||||
{
|
||||
InternalCmpAggStore *store = PG_ARGISNULL(0) ? NULL : (InternalCmpAggStore *) PG_GETARG_POINTER(0);
|
||||
PolyDatum value = polydatum_from_arg(1, fcinfo);
|
||||
@ -390,7 +390,7 @@ first_sfunc(PG_FUNCTION_ARGS)
|
||||
|
||||
/* last(internal internal_state, anyelement value, "any" comparison_element) */
|
||||
Datum
|
||||
last_sfunc(PG_FUNCTION_ARGS)
|
||||
ts_last_sfunc(PG_FUNCTION_ARGS)
|
||||
{
|
||||
InternalCmpAggStore *store = PG_ARGISNULL(0) ? NULL : (InternalCmpAggStore *) PG_GETARG_POINTER(0);
|
||||
PolyDatum value = polydatum_from_arg(1, fcinfo);
|
||||
@ -408,7 +408,7 @@ last_sfunc(PG_FUNCTION_ARGS)
|
||||
|
||||
/* first_combinerfunc(internal, internal) => internal */
|
||||
Datum
|
||||
first_combinefunc(PG_FUNCTION_ARGS)
|
||||
ts_first_combinefunc(PG_FUNCTION_ARGS)
|
||||
{
|
||||
MemoryContext aggcontext;
|
||||
InternalCmpAggStore *state1 = PG_ARGISNULL(0) ? NULL : (InternalCmpAggStore *) PG_GETARG_POINTER(0);
|
||||
@ -417,14 +417,14 @@ first_combinefunc(PG_FUNCTION_ARGS)
|
||||
if (!AggCheckCallContext(fcinfo, &aggcontext))
|
||||
{
|
||||
/* cannot be called directly because of internal-type argument */
|
||||
elog(ERROR, "first_combinefunc called in non-aggregate context");
|
||||
elog(ERROR, "ts_first_combinefunc called in non-aggregate context");
|
||||
}
|
||||
return bookend_combinefunc(aggcontext, state1, state2, "<", fcinfo);
|
||||
}
|
||||
|
||||
/* last_combinerfunc(internal, internal) => internal */
|
||||
Datum
|
||||
last_combinefunc(PG_FUNCTION_ARGS)
|
||||
ts_last_combinefunc(PG_FUNCTION_ARGS)
|
||||
{
|
||||
MemoryContext aggcontext;
|
||||
InternalCmpAggStore *state1 = PG_ARGISNULL(0) ? NULL : (InternalCmpAggStore *) PG_GETARG_POINTER(0);
|
||||
@ -433,15 +433,15 @@ last_combinefunc(PG_FUNCTION_ARGS)
|
||||
if (!AggCheckCallContext(fcinfo, &aggcontext))
|
||||
{
|
||||
/* cannot be called directly because of internal-type argument */
|
||||
elog(ERROR, "last_combinefunc called in non-aggregate context");
|
||||
elog(ERROR, "ts_last_combinefunc called in non-aggregate context");
|
||||
}
|
||||
return bookend_combinefunc(aggcontext, state1, state2, ">", fcinfo);
|
||||
}
|
||||
|
||||
|
||||
/* bookend_serializefunc(internal) => bytea */
|
||||
/* ts_bookend_serializefunc(internal) => bytea */
|
||||
Datum
|
||||
bookend_serializefunc(PG_FUNCTION_ARGS)
|
||||
ts_bookend_serializefunc(PG_FUNCTION_ARGS)
|
||||
{
|
||||
StringInfoData buf;
|
||||
InternalCmpAggStoreIOState *my_extra;
|
||||
@ -463,9 +463,9 @@ bookend_serializefunc(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_BYTEA_P(pq_endtypsend(&buf));
|
||||
}
|
||||
|
||||
/* bookend_deserializefunc(bytea, internal) => internal */
|
||||
/* ts_bookend_deserializefunc(bytea, internal) => internal */
|
||||
Datum
|
||||
bookend_deserializefunc(PG_FUNCTION_ARGS)
|
||||
ts_bookend_deserializefunc(PG_FUNCTION_ARGS)
|
||||
{
|
||||
bytea *sstate;
|
||||
StringInfoData buf;
|
||||
@ -499,16 +499,16 @@ bookend_deserializefunc(PG_FUNCTION_ARGS)
|
||||
}
|
||||
|
||||
|
||||
/* bookend_finalfunc(internal, anyelement, "any") => anyelement */
|
||||
/* ts_bookend_finalfunc(internal, anyelement, "any") => anyelement */
|
||||
Datum
|
||||
bookend_finalfunc(PG_FUNCTION_ARGS)
|
||||
ts_bookend_finalfunc(PG_FUNCTION_ARGS)
|
||||
{
|
||||
InternalCmpAggStore *state;
|
||||
|
||||
if (!AggCheckCallContext(fcinfo, NULL))
|
||||
{
|
||||
/* cannot be called directly because of internal-type argument */
|
||||
elog(ERROR, "bookend_finalfunc called in non-aggregate context");
|
||||
elog(ERROR, "ts_bookend_finalfunc called in non-aggregate context");
|
||||
}
|
||||
|
||||
|
||||
|
@ -72,7 +72,7 @@ cache_invalidate_callback(Datum arg, Oid relid)
|
||||
hypertable_cache_invalidate_callback();
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(timescaledb_invalidate_cache);
|
||||
TS_FUNCTION_INFO_V1(ts_timescaledb_invalidate_cache);
|
||||
|
||||
/*
|
||||
* Force a cache invalidation for a catalog table.
|
||||
@ -84,7 +84,7 @@ TS_FUNCTION_INFO_V1(timescaledb_invalidate_cache);
|
||||
* cache invalidation.
|
||||
*/
|
||||
Datum
|
||||
timescaledb_invalidate_cache(PG_FUNCTION_ARGS)
|
||||
ts_timescaledb_invalidate_cache(PG_FUNCTION_ARGS)
|
||||
{
|
||||
catalog_invalidate_cache(PG_GETARG_OID(0), CMD_UPDATE);
|
||||
PG_RETURN_VOID();
|
||||
|
@ -51,10 +51,10 @@ convert_text_memory_amount_to_bytes(const char *memory_amount)
|
||||
* Exposed for testing purposes to be able to simulate a different memory
|
||||
* cache size in tests.
|
||||
*/
|
||||
TS_FUNCTION_INFO_V1(set_memory_cache_size);
|
||||
TS_FUNCTION_INFO_V1(ts_set_memory_cache_size);
|
||||
|
||||
Datum
|
||||
set_memory_cache_size(PG_FUNCTION_ARGS)
|
||||
ts_set_memory_cache_size(PG_FUNCTION_ARGS)
|
||||
{
|
||||
const char *memory_amount = text_to_cstring(PG_GETARG_TEXT_P(0));
|
||||
|
||||
@ -304,7 +304,7 @@ chunk_get_attno(Oid hypertable_relid, Oid chunk_relid, AttrNumber hypertable_att
|
||||
* and be used in normal prediction mode */
|
||||
#define UNDERSIZED_FILLFACTOR_THRESH (SIZE_FILLFACTOR_THRESH * 1.1)
|
||||
|
||||
TS_FUNCTION_INFO_V1(calculate_chunk_interval);
|
||||
TS_FUNCTION_INFO_V1(ts_calculate_chunk_interval);
|
||||
|
||||
/*
|
||||
* Calculate a new interval for a chunk in a given dimension.
|
||||
@ -386,7 +386,7 @@ TS_FUNCTION_INFO_V1(calculate_chunk_interval);
|
||||
* further if needed.
|
||||
*/
|
||||
Datum
|
||||
calculate_chunk_interval(PG_FUNCTION_ARGS)
|
||||
ts_calculate_chunk_interval(PG_FUNCTION_ARGS)
|
||||
{
|
||||
int32 dimension_id = PG_GETARG_INT32(0);
|
||||
int64 dimension_coord = PG_GETARG_INT64(1);
|
||||
@ -687,13 +687,13 @@ chunk_adaptive_sizing_info_validate(ChunkSizingInfo *info)
|
||||
errdetail("Adaptive chunking works best with an index on the dimension being adapted.")));
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(chunk_adaptive_set);
|
||||
TS_FUNCTION_INFO_V1(ts_chunk_adaptive_set);
|
||||
|
||||
/*
|
||||
* Change the settings for adaptive chunking.
|
||||
*/
|
||||
Datum
|
||||
chunk_adaptive_set(PG_FUNCTION_ARGS)
|
||||
ts_chunk_adaptive_set(PG_FUNCTION_ARGS)
|
||||
{
|
||||
ChunkSizingInfo info = {
|
||||
.table_relid = PG_GETARG_OID(0),
|
||||
|
@ -925,9 +925,9 @@ chunk_index_mark_clustered(Oid chunkrelid, Oid indexrelid)
|
||||
heap_close(rel, AccessShareLock);
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(chunk_index_clone);
|
||||
TS_FUNCTION_INFO_V1(ts_chunk_index_clone);
|
||||
Datum
|
||||
chunk_index_clone(PG_FUNCTION_ARGS)
|
||||
ts_chunk_index_clone(PG_FUNCTION_ARGS)
|
||||
{
|
||||
Oid chunk_index_oid = PG_GETARG_OID(0);
|
||||
Relation chunk_index_rel;
|
||||
@ -962,9 +962,9 @@ chunk_index_clone(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_OID(new_chunk_indexrelid);
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(chunk_index_replace);
|
||||
TS_FUNCTION_INFO_V1(ts_chunk_index_replace);
|
||||
Datum
|
||||
chunk_index_replace(PG_FUNCTION_ARGS)
|
||||
ts_chunk_index_replace(PG_FUNCTION_ARGS)
|
||||
{
|
||||
Oid chunk_index_oid_old = PG_GETARG_OID(0);
|
||||
Oid chunk_index_oid_new = PG_GETARG_OID(1);
|
||||
|
@ -47,7 +47,7 @@ extern void chunk_index_mark_clustered(Oid chunkrelid, Oid indexrelid);
|
||||
* Note that both reindex and recreate both block writes to table. Also note that recreate
|
||||
* will use more disk space than reindex during phase 1 and does more total work.
|
||||
*/
|
||||
PGDLLEXPORT Datum chunk_index_clone(PG_FUNCTION_ARGS);
|
||||
PGDLLEXPORT Datum chunk_index_replace(PG_FUNCTION_ARGS);
|
||||
PGDLLEXPORT Datum ts_chunk_index_clone(PG_FUNCTION_ARGS);
|
||||
PGDLLEXPORT Datum ts_chunk_index_replace(PG_FUNCTION_ARGS);
|
||||
|
||||
#endif /* TIMESCALEDB_CHUNK_INDEX_H */
|
||||
|
@ -213,13 +213,13 @@ calculate_open_range_default(Dimension *dim, int64 value)
|
||||
return dimension_slice_create(dim->fd.id, range_start, range_end);
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(dimension_calculate_open_range_default);
|
||||
TS_FUNCTION_INFO_V1(ts_dimension_calculate_open_range_default);
|
||||
|
||||
/*
|
||||
* Expose open dimension range calculation for testing purposes.
|
||||
*/
|
||||
Datum
|
||||
dimension_calculate_open_range_default(PG_FUNCTION_ARGS)
|
||||
ts_dimension_calculate_open_range_default(PG_FUNCTION_ARGS)
|
||||
{
|
||||
int64 value = PG_GETARG_INT64(0);
|
||||
Dimension dim = {
|
||||
@ -264,13 +264,13 @@ calculate_closed_range_default(Dimension *dim, int64 value)
|
||||
return dimension_slice_create(dim->fd.id, range_start, range_end);
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(dimension_calculate_closed_range_default);
|
||||
TS_FUNCTION_INFO_V1(ts_dimension_calculate_closed_range_default);
|
||||
|
||||
/*
|
||||
* Exposed closed dimension range calculation for testing purposes.
|
||||
*/
|
||||
Datum
|
||||
dimension_calculate_closed_range_default(PG_FUNCTION_ARGS)
|
||||
ts_dimension_calculate_closed_range_default(PG_FUNCTION_ARGS)
|
||||
{
|
||||
int64 value = PG_GETARG_INT64(0);
|
||||
Dimension dim = {
|
||||
@ -740,13 +740,13 @@ dimension_interval_to_internal(const char *colname,
|
||||
return interval;
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(dimension_interval_to_internal_test);
|
||||
TS_FUNCTION_INFO_V1(ts_dimension_interval_to_internal_test);
|
||||
|
||||
/*
|
||||
* Exposed for testing purposes.
|
||||
*/
|
||||
Datum
|
||||
dimension_interval_to_internal_test(PG_FUNCTION_ARGS)
|
||||
ts_dimension_interval_to_internal_test(PG_FUNCTION_ARGS)
|
||||
{
|
||||
Oid coltype = PG_GETARG_OID(0);
|
||||
Datum value = PG_GETARG_DATUM(1);
|
||||
@ -839,10 +839,10 @@ dimension_update(FunctionCallInfo fcinfo,
|
||||
cache_release(hcache);
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(dimension_set_num_slices);
|
||||
TS_FUNCTION_INFO_V1(ts_dimension_set_num_slices);
|
||||
|
||||
Datum
|
||||
dimension_set_num_slices(PG_FUNCTION_ARGS)
|
||||
ts_dimension_set_num_slices(PG_FUNCTION_ARGS)
|
||||
{
|
||||
Oid table_relid = PG_GETARG_OID(0);
|
||||
int32 num_slices_arg = PG_ARGISNULL(1) ? -1 : PG_GETARG_INT32(1);
|
||||
@ -869,10 +869,10 @@ dimension_set_num_slices(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_VOID();
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(dimension_set_interval);
|
||||
TS_FUNCTION_INFO_V1(ts_dimension_set_interval);
|
||||
|
||||
Datum
|
||||
dimension_set_interval(PG_FUNCTION_ARGS)
|
||||
ts_dimension_set_interval(PG_FUNCTION_ARGS)
|
||||
{
|
||||
Oid table_relid = PG_GETARG_OID(0);
|
||||
Datum interval = PG_GETARG_DATUM(1);
|
||||
@ -999,7 +999,7 @@ dimension_add_from_info(DimensionInfo *info)
|
||||
info->num_slices, info->partitioning_func, info->interval);
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(dimension_add);
|
||||
TS_FUNCTION_INFO_V1(ts_dimension_add);
|
||||
|
||||
/*
|
||||
* Add a new dimension to a hypertable.
|
||||
@ -1013,7 +1013,7 @@ TS_FUNCTION_INFO_V1(dimension_add);
|
||||
* 5. IF NOT EXISTS option (bool)
|
||||
*/
|
||||
Datum
|
||||
dimension_add(PG_FUNCTION_ARGS)
|
||||
ts_dimension_add(PG_FUNCTION_ARGS)
|
||||
{
|
||||
Cache *hcache = hypertable_cache_pin();
|
||||
DimensionInfo info = {
|
||||
|
@ -23,15 +23,15 @@
|
||||
* nbucket+2 buckets accounting for buckets outside the range.
|
||||
*/
|
||||
|
||||
TS_FUNCTION_INFO_V1(hist_sfunc);
|
||||
TS_FUNCTION_INFO_V1(hist_combinefunc);
|
||||
TS_FUNCTION_INFO_V1(hist_serializefunc);
|
||||
TS_FUNCTION_INFO_V1(hist_deserializefunc);
|
||||
TS_FUNCTION_INFO_V1(hist_finalfunc);
|
||||
TS_FUNCTION_INFO_V1(ts_hist_sfunc);
|
||||
TS_FUNCTION_INFO_V1(ts_hist_combinefunc);
|
||||
TS_FUNCTION_INFO_V1(ts_hist_serializefunc);
|
||||
TS_FUNCTION_INFO_V1(ts_hist_deserializefunc);
|
||||
TS_FUNCTION_INFO_V1(ts_hist_finalfunc);
|
||||
|
||||
/* histogram(state, val, min, max, nbuckets) */
|
||||
Datum
|
||||
hist_sfunc(PG_FUNCTION_ARGS)
|
||||
ts_hist_sfunc(PG_FUNCTION_ARGS)
|
||||
{
|
||||
MemoryContext aggcontext;
|
||||
bytea *state = (PG_ARGISNULL(0) ? NULL : PG_GETARG_BYTEA_P(0));
|
||||
@ -48,7 +48,7 @@ hist_sfunc(PG_FUNCTION_ARGS)
|
||||
if (!AggCheckCallContext(fcinfo, &aggcontext))
|
||||
{
|
||||
/* cannot be called directly because of internal-type argument */
|
||||
elog(ERROR, "hist_sfunc called in non-aggregate context");
|
||||
elog(ERROR, "ts_hist_sfunc called in non-aggregate context");
|
||||
}
|
||||
|
||||
if (min > max)
|
||||
@ -87,9 +87,9 @@ copy_state(MemoryContext aggcontext, bytea *state)
|
||||
return copy;
|
||||
}
|
||||
|
||||
/* hist_combinefunc(internal, internal) => internal */
|
||||
/* ts_hist_combinefunc(internal, internal) => internal */
|
||||
Datum
|
||||
hist_combinefunc(PG_FUNCTION_ARGS)
|
||||
ts_hist_combinefunc(PG_FUNCTION_ARGS)
|
||||
{
|
||||
MemoryContext aggcontext;
|
||||
|
||||
@ -100,7 +100,7 @@ hist_combinefunc(PG_FUNCTION_ARGS)
|
||||
if (!AggCheckCallContext(fcinfo, &aggcontext))
|
||||
{
|
||||
/* cannot be called directly because of internal-type argument */
|
||||
elog(ERROR, "hist_combinefunc called in non-aggregate context");
|
||||
elog(ERROR, "ts_hist_combinefunc called in non-aggregate context");
|
||||
}
|
||||
|
||||
if (state2 == NULL)
|
||||
@ -131,9 +131,9 @@ hist_combinefunc(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_BYTEA_P(result);
|
||||
}
|
||||
|
||||
/* hist_serializefunc(internal) => bytea */
|
||||
/* ts_hist_serializefunc(internal) => bytea */
|
||||
Datum
|
||||
hist_serializefunc(PG_FUNCTION_ARGS)
|
||||
ts_hist_serializefunc(PG_FUNCTION_ARGS)
|
||||
{
|
||||
bytea *state;
|
||||
Datum *hist;
|
||||
@ -151,9 +151,9 @@ hist_serializefunc(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_BYTEA_P(state);
|
||||
}
|
||||
|
||||
/* hist_deserializefunc(bytea, internal) => internal */
|
||||
/* ts_hist_deserializefunc(bytea, internal) => internal */
|
||||
Datum
|
||||
hist_deserializefunc(PG_FUNCTION_ARGS)
|
||||
ts_hist_deserializefunc(PG_FUNCTION_ARGS)
|
||||
{
|
||||
bytea *state;
|
||||
Datum *hist;
|
||||
@ -173,7 +173,7 @@ hist_deserializefunc(PG_FUNCTION_ARGS)
|
||||
|
||||
/* hist_funalfunc(internal, val REAL, MIN REAL, MAX REAL, nbuckets INTEGER) => INTEGER[] */
|
||||
Datum
|
||||
hist_finalfunc(PG_FUNCTION_ARGS)
|
||||
ts_hist_finalfunc(PG_FUNCTION_ARGS)
|
||||
{
|
||||
bytea *state;
|
||||
Datum *hist;
|
||||
@ -183,7 +183,7 @@ hist_finalfunc(PG_FUNCTION_ARGS)
|
||||
if (!AggCheckCallContext(fcinfo, NULL))
|
||||
{
|
||||
/* cannot be called directly because of internal-type argument */
|
||||
elog(ERROR, "hist_finalfunc called in non-aggregate context");
|
||||
elog(ERROR, "ts_hist_finalfunc called in non-aggregate context");
|
||||
}
|
||||
|
||||
if (PG_ARGISNULL(0))
|
||||
|
@ -1035,10 +1035,10 @@ hypertable_validate_constraints(Oid relid)
|
||||
* included in a pg_dump. We also add logic to make sure this trigger is not
|
||||
* propagated to chunks.
|
||||
*/
|
||||
TS_FUNCTION_INFO_V1(hypertable_insert_blocker);
|
||||
TS_FUNCTION_INFO_V1(ts_hypertable_insert_blocker);
|
||||
|
||||
Datum
|
||||
hypertable_insert_blocker(PG_FUNCTION_ARGS)
|
||||
ts_hypertable_insert_blocker(PG_FUNCTION_ARGS)
|
||||
{
|
||||
TriggerData *trigdata = (TriggerData *) fcinfo->context;
|
||||
const char *relname = get_rel_name(trigdata->tg_relation->rd_id);
|
||||
@ -1141,7 +1141,7 @@ insert_blocker_trigger_add(Oid relid)
|
||||
return objaddr.objectId;
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(hypertable_insert_blocker_trigger_add);
|
||||
TS_FUNCTION_INFO_V1(ts_hypertable_insert_blocker_trigger_add);
|
||||
|
||||
/*
|
||||
* This function is exposed to drop the old blocking trigger on legacy hypertables.
|
||||
@ -1152,7 +1152,7 @@ TS_FUNCTION_INFO_V1(hypertable_insert_blocker_trigger_add);
|
||||
* error instructing the user to fix the issue first.
|
||||
*/
|
||||
Datum
|
||||
hypertable_insert_blocker_trigger_add(PG_FUNCTION_ARGS)
|
||||
ts_hypertable_insert_blocker_trigger_add(PG_FUNCTION_ARGS)
|
||||
{
|
||||
Oid relid = PG_GETARG_OID(0);
|
||||
Oid old_trigger;
|
||||
@ -1187,7 +1187,7 @@ hypertable_insert_blocker_trigger_add(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_OID(insert_blocker_trigger_add(relid));
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(hypertable_create);
|
||||
TS_FUNCTION_INFO_V1(ts_hypertable_create);
|
||||
|
||||
/*
|
||||
* Create a hypertable from an existing table.
|
||||
@ -1208,7 +1208,7 @@ TS_FUNCTION_INFO_V1(hypertable_create);
|
||||
* chunk_target_size TEXT = NULL
|
||||
*/
|
||||
Datum
|
||||
hypertable_create(PG_FUNCTION_ARGS)
|
||||
ts_hypertable_create(PG_FUNCTION_ARGS)
|
||||
{
|
||||
Oid table_relid = PG_GETARG_OID(0);
|
||||
Name associated_schema_name = PG_ARGISNULL(4) ? NULL : PG_GETARG_NAME(4);
|
||||
|
@ -310,17 +310,17 @@ part_func_cache_create(Oid argtype, TypeCacheEntry *tce, Oid coerce_funcid, Memo
|
||||
return pfc;
|
||||
}
|
||||
|
||||
/* _timescaledb_catalog.get_partition_for_key(key anyelement) RETURNS INT */
|
||||
PGDLLEXPORT Datum get_partition_for_key(PG_FUNCTION_ARGS);
|
||||
/* _timescaledb_catalog.ts_get_partition_for_key(key anyelement) RETURNS INT */
|
||||
PGDLLEXPORT Datum ts_get_partition_for_key(PG_FUNCTION_ARGS);
|
||||
|
||||
TS_FUNCTION_INFO_V1(get_partition_for_key);
|
||||
TS_FUNCTION_INFO_V1(ts_get_partition_for_key);
|
||||
|
||||
/*
|
||||
* Partition hash function that first converts all inputs to text before
|
||||
* hashing.
|
||||
*/
|
||||
Datum
|
||||
get_partition_for_key(PG_FUNCTION_ARGS)
|
||||
ts_get_partition_for_key(PG_FUNCTION_ARGS)
|
||||
{
|
||||
Datum arg = PG_GETARG_DATUM(0);
|
||||
PartFuncCache *pfc = fcinfo->flinfo->fn_extra;
|
||||
@ -365,21 +365,21 @@ get_partition_for_key(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_INT32(res);
|
||||
}
|
||||
|
||||
PGDLLEXPORT Datum get_partition_hash(PG_FUNCTION_ARGS);
|
||||
PGDLLEXPORT Datum ts_get_partition_hash(PG_FUNCTION_ARGS);
|
||||
|
||||
TS_FUNCTION_INFO_V1(get_partition_hash);
|
||||
TS_FUNCTION_INFO_V1(ts_get_partition_hash);
|
||||
|
||||
/*
|
||||
* Compute a partition hash value for any input type.
|
||||
*
|
||||
* get_partition_hash() takes a single argument of anyelement type. We compute
|
||||
* ts_get_partition_hash() takes a single argument of anyelement type. We compute
|
||||
* the hash based on the argument type information that we expect to find in the
|
||||
* function expression in the function call context. If no such expression
|
||||
* exists, or the type cannot be resolved from the expression, the function
|
||||
* throws an error.
|
||||
*/
|
||||
Datum
|
||||
get_partition_hash(PG_FUNCTION_ARGS)
|
||||
ts_get_partition_hash(PG_FUNCTION_ARGS)
|
||||
{
|
||||
Datum arg = PG_GETARG_DATUM(0);
|
||||
PartFuncCache *pfc = fcinfo->flinfo->fn_extra;
|
||||
|
@ -2252,13 +2252,13 @@ process_ddl_event_command_end(EventTriggerData *trigdata)
|
||||
EventTriggerUndoInhibitCommandCollection();
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(timescaledb_process_ddl_event);
|
||||
TS_FUNCTION_INFO_V1(ts_timescaledb_process_ddl_event);
|
||||
/*
|
||||
* Event trigger hook for DDL commands that have alread been handled by
|
||||
* PostgreSQL (i.e., "ddl_command_end" and "sql_drop" events).
|
||||
*/
|
||||
Datum
|
||||
timescaledb_process_ddl_event(PG_FUNCTION_ARGS)
|
||||
ts_timescaledb_process_ddl_event(PG_FUNCTION_ARGS)
|
||||
{
|
||||
EventTriggerData *trigdata = (EventTriggerData *) fcinfo->context;
|
||||
ListCell *lc;
|
||||
|
@ -454,10 +454,10 @@ tablespace_delete_from_all(const char *tspcname, Oid userid)
|
||||
return num_deleted;
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(tablespace_attach);
|
||||
TS_FUNCTION_INFO_V1(ts_tablespace_attach);
|
||||
|
||||
Datum
|
||||
tablespace_attach(PG_FUNCTION_ARGS)
|
||||
ts_tablespace_attach(PG_FUNCTION_ARGS)
|
||||
{
|
||||
Name tspcname = PG_ARGISNULL(0) ? NULL : PG_GETARG_NAME(0);
|
||||
Oid hypertable_oid = PG_ARGISNULL(1) ? InvalidOid : PG_GETARG_OID(1);
|
||||
@ -604,10 +604,10 @@ tablespace_detach_all(Oid hypertable_oid)
|
||||
return ret;
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(tablespace_detach);
|
||||
TS_FUNCTION_INFO_V1(ts_tablespace_detach);
|
||||
|
||||
Datum
|
||||
tablespace_detach(PG_FUNCTION_ARGS)
|
||||
ts_tablespace_detach(PG_FUNCTION_ARGS)
|
||||
{
|
||||
Name tspcname = PG_ARGISNULL(0) ? NULL : PG_GETARG_NAME(0);
|
||||
Oid hypertable_oid = PG_ARGISNULL(1) ? InvalidOid : PG_GETARG_OID(1);
|
||||
@ -644,10 +644,10 @@ tablespace_detach(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_INT32(ret);
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(tablespace_detach_all_from_hypertable);
|
||||
TS_FUNCTION_INFO_V1(ts_tablespace_detach_all_from_hypertable);
|
||||
|
||||
Datum
|
||||
tablespace_detach_all_from_hypertable(PG_FUNCTION_ARGS)
|
||||
ts_tablespace_detach_all_from_hypertable(PG_FUNCTION_ARGS)
|
||||
{
|
||||
if (PG_NARGS() != 1)
|
||||
elog(ERROR, "invalid number of arguments");
|
||||
@ -658,10 +658,10 @@ tablespace_detach_all_from_hypertable(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_INT32(tablespace_detach_all(PG_GETARG_OID(0)));
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(tablespace_show);
|
||||
TS_FUNCTION_INFO_V1(ts_tablespace_show);
|
||||
|
||||
Datum
|
||||
tablespace_show(PG_FUNCTION_ARGS)
|
||||
ts_tablespace_show(PG_FUNCTION_ARGS)
|
||||
{
|
||||
FuncCallContext *funcctx;
|
||||
Oid hypertable_oid = PG_ARGISNULL(0) ? InvalidOid : PG_GETARG_OID(0);
|
||||
|
40
src/utils.c
40
src/utils.c
@ -29,13 +29,13 @@
|
||||
#include <utils/fmgrprotos.h>
|
||||
#endif
|
||||
|
||||
TS_FUNCTION_INFO_V1(pg_timestamp_to_microseconds);
|
||||
TS_FUNCTION_INFO_V1(ts_pg_timestamp_to_microseconds);
|
||||
|
||||
/*
|
||||
* Convert a Postgres TIMESTAMP to BIGINT microseconds relative the Postgres epoch.
|
||||
*/
|
||||
Datum
|
||||
pg_timestamp_to_microseconds(PG_FUNCTION_ARGS)
|
||||
ts_pg_timestamp_to_microseconds(PG_FUNCTION_ARGS)
|
||||
{
|
||||
TimestampTz timestamp = PG_GETARG_TIMESTAMPTZ(0);
|
||||
int64 microseconds;
|
||||
@ -58,13 +58,13 @@ pg_timestamp_to_microseconds(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_INT64(microseconds);
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(pg_microseconds_to_timestamp);
|
||||
TS_FUNCTION_INFO_V1(ts_pg_microseconds_to_timestamp);
|
||||
|
||||
/*
|
||||
* Convert BIGINT microseconds relative the UNIX epoch to a Postgres TIMESTAMP.
|
||||
*/
|
||||
Datum
|
||||
pg_microseconds_to_timestamp(PG_FUNCTION_ARGS)
|
||||
ts_pg_microseconds_to_timestamp(PG_FUNCTION_ARGS)
|
||||
{
|
||||
int64 microseconds = PG_GETARG_INT64(0);
|
||||
TimestampTz timestamp;
|
||||
@ -83,13 +83,13 @@ pg_microseconds_to_timestamp(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_TIMESTAMPTZ(timestamp);
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(pg_timestamp_to_unix_microseconds);
|
||||
TS_FUNCTION_INFO_V1(ts_pg_timestamp_to_unix_microseconds);
|
||||
|
||||
/*
|
||||
* Convert a Postgres TIMESTAMP to BIGINT microseconds relative the UNIX epoch.
|
||||
*/
|
||||
Datum
|
||||
pg_timestamp_to_unix_microseconds(PG_FUNCTION_ARGS)
|
||||
ts_pg_timestamp_to_unix_microseconds(PG_FUNCTION_ARGS)
|
||||
{
|
||||
TimestampTz timestamp = PG_GETARG_TIMESTAMPTZ(0);
|
||||
int64 epoch_diff_microseconds = (POSTGRES_EPOCH_JDATE - UNIX_EPOCH_JDATE) * USECS_PER_DAY;
|
||||
@ -118,13 +118,13 @@ pg_timestamp_to_unix_microseconds(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_INT64(microseconds);
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(pg_unix_microseconds_to_timestamp);
|
||||
TS_FUNCTION_INFO_V1(ts_pg_unix_microseconds_to_timestamp);
|
||||
|
||||
/*
|
||||
* Convert BIGINT microseconds relative the UNIX epoch to a Postgres TIMESTAMP.
|
||||
*/
|
||||
Datum
|
||||
pg_unix_microseconds_to_timestamp(PG_FUNCTION_ARGS)
|
||||
ts_pg_unix_microseconds_to_timestamp(PG_FUNCTION_ARGS)
|
||||
{
|
||||
int64 microseconds = PG_GETARG_INT64(0);
|
||||
TimestampTz timestamp;
|
||||
@ -152,10 +152,10 @@ pg_unix_microseconds_to_timestamp(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_TIMESTAMPTZ(timestamp);
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(time_to_internal);
|
||||
TS_FUNCTION_INFO_V1(ts_time_to_internal);
|
||||
|
||||
Datum
|
||||
time_to_internal(PG_FUNCTION_ARGS)
|
||||
ts_time_to_internal(PG_FUNCTION_ARGS)
|
||||
{
|
||||
if (PG_ARGISNULL(0))
|
||||
PG_RETURN_NULL();
|
||||
@ -184,16 +184,16 @@ time_value_to_internal(Datum time_val, Oid type_oid, bool failure_ok)
|
||||
* for timestamps, ignore timezones, make believe the timestamp is
|
||||
* at UTC
|
||||
*/
|
||||
res = DirectFunctionCall1(pg_timestamp_to_unix_microseconds, time_val);
|
||||
res = DirectFunctionCall1(ts_pg_timestamp_to_unix_microseconds, time_val);
|
||||
|
||||
return DatumGetInt64(res);
|
||||
case TIMESTAMPTZOID:
|
||||
res = DirectFunctionCall1(pg_timestamp_to_unix_microseconds, time_val);
|
||||
res = DirectFunctionCall1(ts_pg_timestamp_to_unix_microseconds, time_val);
|
||||
|
||||
return DatumGetInt64(res);
|
||||
case DATEOID:
|
||||
tz = DirectFunctionCall1(date_timestamp, time_val);
|
||||
res = DirectFunctionCall1(pg_timestamp_to_unix_microseconds, tz);
|
||||
res = DirectFunctionCall1(ts_pg_timestamp_to_unix_microseconds, tz);
|
||||
|
||||
return DatumGetInt64(res);
|
||||
default:
|
||||
@ -275,9 +275,9 @@ get_interval_period_timestamp_units(Interval *interval)
|
||||
#endif
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(timestamp_bucket);
|
||||
TS_FUNCTION_INFO_V1(ts_timestamp_bucket);
|
||||
Datum
|
||||
timestamp_bucket(PG_FUNCTION_ARGS)
|
||||
ts_timestamp_bucket(PG_FUNCTION_ARGS)
|
||||
{
|
||||
Interval *interval = PG_GETARG_INTERVAL_P(0);
|
||||
Timestamp timestamp = PG_GETARG_TIMESTAMP(1);
|
||||
@ -307,9 +307,9 @@ timestamp_bucket(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_TIMESTAMP(result);
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(timestamptz_bucket);
|
||||
TS_FUNCTION_INFO_V1(ts_timestamptz_bucket);
|
||||
Datum
|
||||
timestamptz_bucket(PG_FUNCTION_ARGS)
|
||||
ts_timestamptz_bucket(PG_FUNCTION_ARGS)
|
||||
{
|
||||
Interval *interval = PG_GETARG_INTERVAL_P(0);
|
||||
TimestampTz timestamp = PG_GETARG_TIMESTAMPTZ(1);
|
||||
@ -364,10 +364,10 @@ check_period_is_daily(int64 period)
|
||||
}
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(date_bucket);
|
||||
TS_FUNCTION_INFO_V1(ts_date_bucket);
|
||||
|
||||
Datum
|
||||
date_bucket(PG_FUNCTION_ARGS)
|
||||
ts_date_bucket(PG_FUNCTION_ARGS)
|
||||
{
|
||||
Interval *interval = PG_GETARG_INTERVAL_P(0);
|
||||
DateADT date = PG_GETARG_DATEADT(1);
|
||||
@ -384,7 +384,7 @@ date_bucket(PG_FUNCTION_ARGS)
|
||||
|
||||
/* convert to timestamp (NOT tz), bucket, convert back to date */
|
||||
converted_ts = DirectFunctionCall1(date_timestamp, PG_GETARG_DATUM(1));
|
||||
bucketed = DirectFunctionCall2(timestamp_bucket, PG_GETARG_DATUM(0), converted_ts);
|
||||
bucketed = DirectFunctionCall2(ts_timestamp_bucket, PG_GETARG_DATUM(0), converted_ts);
|
||||
return DirectFunctionCall1(timestamp_date, bucketed);
|
||||
}
|
||||
|
||||
|
@ -159,10 +159,10 @@ ts_version_get_info(PG_FUNCTION_ARGS)
|
||||
|
||||
const char *git_commit = STR(EXT_GIT_COMMIT);
|
||||
|
||||
TS_FUNCTION_INFO_V1(get_git_commit);
|
||||
TS_FUNCTION_INFO_V1(ts_get_git_commit);
|
||||
|
||||
Datum
|
||||
get_git_commit(PG_FUNCTION_ARGS)
|
||||
ts_get_git_commit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
size_t var_size = VARHDRSZ + strlen(git_commit);
|
||||
text *version_text = (text *) palloc(var_size);
|
||||
|
@ -1,10 +1,10 @@
|
||||
\c single :ROLE_SUPERUSER
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_uuid() RETURNS UUID
|
||||
AS :MODULE_PATHNAME, 'test_uuid' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_uuid' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_exported_uuid() RETURNS UUID
|
||||
AS :MODULE_PATHNAME, 'test_exported_uuid' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_exported_uuid' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_install_timestamp() RETURNS TIMESTAMPTZ
|
||||
AS :MODULE_PATHNAME, 'test_install_timestamp' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_install_timestamp' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
\c single :ROLE_DEFAULT_PERM_USER
|
||||
-- uuid and install_timestamp should already be in the table before we generate
|
||||
SELECT COUNT(*) from _timescaledb_catalog.installation_metadata;
|
||||
|
@ -1,12 +1,12 @@
|
||||
\c single :ROLE_SUPERUSER
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_http_parsing(int) RETURNS VOID
|
||||
AS :MODULE_PATHNAME, 'test_http_parsing' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_http_parsing' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_http_parsing_full() RETURNS VOID
|
||||
AS :MODULE_PATHNAME, 'test_http_parsing_full' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_http_parsing_full' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_http_request_build() RETURNS VOID
|
||||
AS :MODULE_PATHNAME, 'test_http_request_build' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_http_request_build' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_conn() RETURNS VOID
|
||||
AS :MODULE_PATHNAME, 'test_conn' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_conn' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
\c single :ROLE_DEFAULT_PERM_USER
|
||||
SELECT _timescaledb_internal.test_http_parsing(10000);
|
||||
test_http_parsing
|
||||
|
@ -1,6 +1,6 @@
|
||||
\c single :ROLE_SUPERUSER
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_privacy() RETURNS BOOLEAN
|
||||
AS :MODULE_PATHNAME, 'test_privacy' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_privacy' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
\c single :ROLE_DEFAULT_PERM_USER
|
||||
-- Should be off be default in tests
|
||||
SHOW timescaledb.telemetry_level;
|
||||
|
@ -1,16 +1,16 @@
|
||||
\c single :ROLE_SUPERUSER
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_status(int) RETURNS JSONB
|
||||
AS :MODULE_PATHNAME, 'test_status' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_status' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_status_ssl(int) RETURNS JSONB
|
||||
AS :MODULE_PATHNAME, 'test_status_ssl' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_status_ssl' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_status_mock(text) RETURNS JSONB
|
||||
AS :MODULE_PATHNAME, 'test_status_mock' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_status_mock' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_telemetry_parse_version(response text, installed_major int, installed_minor int, installed_patch int, installed_modtag text = NULL)
|
||||
RETURNS TABLE(version_string text, major int, minor int, patch int, modtag text, up_to_date bool)
|
||||
AS :MODULE_PATHNAME, 'test_telemetry_parse_version' LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_telemetry_parse_version' LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_telemetry_main_conn(text, text, text)
|
||||
RETURNS BOOLEAN AS :MODULE_PATHNAME, 'test_telemetry_main_conn' LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_telemetry(host text = NULL, servname text = NULL, port int = NULL) RETURNS JSONB AS :MODULE_PATHNAME, 'test_telemetry' LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
RETURNS BOOLEAN AS :MODULE_PATHNAME, 'ts_test_telemetry_main_conn' LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_telemetry(host text = NULL, servname text = NULL, port int = NULL) RETURNS JSONB AS :MODULE_PATHNAME, 'ts_test_telemetry' LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
\c single :ROLE_DEFAULT_PERM_USER
|
||||
SELECT _timescaledb_internal.test_status_ssl(200);
|
||||
test_status_ssl
|
||||
|
@ -711,7 +711,7 @@ FROM unnest(ARRAY[
|
||||
-------------------------------------
|
||||
\c single :ROLE_SUPERUSER
|
||||
CREATE OR REPLACE FUNCTION test.interval_to_internal(coltype REGTYPE, value ANYELEMENT = NULL::BIGINT) RETURNS BIGINT
|
||||
AS :MODULE_PATHNAME, 'dimension_interval_to_internal_test' LANGUAGE C VOLATILE;
|
||||
AS :MODULE_PATHNAME, 'ts_dimension_interval_to_internal_test' LANGUAGE C VOLATILE;
|
||||
\c single :ROLE_DEFAULT_PERM_USER
|
||||
SELECT test.interval_to_internal('TIMESTAMP'::regtype, INTERVAL '1 day');
|
||||
interval_to_internal
|
||||
|
@ -1,10 +1,10 @@
|
||||
\c single :ROLE_SUPERUSER
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_uuid() RETURNS UUID
|
||||
AS :MODULE_PATHNAME, 'test_uuid' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_uuid' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_exported_uuid() RETURNS UUID
|
||||
AS :MODULE_PATHNAME, 'test_exported_uuid' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_exported_uuid' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_install_timestamp() RETURNS TIMESTAMPTZ
|
||||
AS :MODULE_PATHNAME, 'test_install_timestamp' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_install_timestamp' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
\c single :ROLE_DEFAULT_PERM_USER
|
||||
|
||||
-- uuid and install_timestamp should already be in the table before we generate
|
||||
|
@ -4,4 +4,5 @@ SELECT 1;
|
||||
SELECT 1;
|
||||
SELECT 1;
|
||||
CREATE OR REPLACE FUNCTION mock_function() RETURNS VOID
|
||||
AS '$libdir/timescaledb-mock-2', 'mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '$libdir/timescaledb-mock-2', 'ts_mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
CREATE SCHEMA IF NOT EXISTS _timescaledb_cache;
|
||||
CREATE TABLE IF NOT EXISTS _timescaledb_cache.cache_inval_extension();
|
||||
CREATE OR REPLACE FUNCTION mock_function() RETURNS VOID
|
||||
AS '$libdir/timescaledb-mock-1', 'mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '$libdir/timescaledb-mock-1', 'ts_mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
@ -1,3 +1,3 @@
|
||||
broken sql;
|
||||
CREATE OR REPLACE FUNCTION mock_function() RETURNS VOID
|
||||
AS '$libdir/timescaledb-mock-3', 'mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '$libdir/timescaledb-mock-3', 'ts_mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
@ -1,6 +1,6 @@
|
||||
--create function before proxy table
|
||||
CREATE OR REPLACE FUNCTION mock_function() RETURNS VOID
|
||||
AS '$libdir/timescaledb-mock-2', 'mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '$libdir/timescaledb-mock-2', 'ts_mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
CREATE SCHEMA IF NOT EXISTS _timescaledb_cache;
|
||||
CREATE TABLE IF NOT EXISTS _timescaledb_cache.cache_inval_extension();
|
||||
|
||||
|
@ -4,4 +4,4 @@ SELECT 1;
|
||||
SELECT 1;
|
||||
SELECT 1;
|
||||
CREATE OR REPLACE FUNCTION mock_function() RETURNS VOID
|
||||
AS '$libdir/timescaledb-mock-4', 'mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '$libdir/timescaledb-mock-4', 'ts_mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
@ -1,4 +1,4 @@
|
||||
CREATE SCHEMA IF NOT EXISTS _timescaledb_cache;
|
||||
CREATE TABLE IF NOT EXISTS _timescaledb_cache.cache_inval_extension();
|
||||
CREATE OR REPLACE FUNCTION mock_function() RETURNS VOID
|
||||
AS '$libdir/timescaledb-mock-3', 'mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '$libdir/timescaledb-mock-3', 'ts_mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
@ -1,4 +1,4 @@
|
||||
CREATE SCHEMA IF NOT EXISTS _timescaledb_cache;
|
||||
CREATE TABLE IF NOT EXISTS _timescaledb_cache.cache_inval_extension();
|
||||
CREATE OR REPLACE FUNCTION mock_function() RETURNS VOID
|
||||
AS '$libdir/timescaledb-mock-4', 'mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '$libdir/timescaledb-mock-4', 'ts_mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
@ -5,4 +5,4 @@ SELECT 1;
|
||||
SELECT 1;
|
||||
--intentionally forget to updat func
|
||||
--CREATE OR REPLACE FUNCTION mock_function() RETURNS VOID
|
||||
-- AS '$libdir/timescaledb-mock-6', 'mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
-- AS '$libdir/timescaledb-mock-6', 'ts_mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
@ -1,4 +1,4 @@
|
||||
CREATE SCHEMA IF NOT EXISTS _timescaledb_cache;
|
||||
CREATE TABLE IF NOT EXISTS _timescaledb_cache.cache_inval_extension();
|
||||
CREATE OR REPLACE FUNCTION mock_function() RETURNS VOID
|
||||
AS '$libdir/timescaledb-mock-5', 'mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '$libdir/timescaledb-mock-5', 'ts_mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
@ -1,4 +1,4 @@
|
||||
CREATE SCHEMA IF NOT EXISTS _timescaledb_cache;
|
||||
CREATE TABLE IF NOT EXISTS _timescaledb_cache.cache_inval_extension();
|
||||
CREATE OR REPLACE FUNCTION mock_function() RETURNS VOID
|
||||
AS '$libdir/timescaledb-mock-6', 'mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '$libdir/timescaledb-mock-6', 'ts_mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
@ -4,4 +4,4 @@ SELECT 1;
|
||||
SELECT 1;
|
||||
SELECT 1;
|
||||
CREATE OR REPLACE FUNCTION mock_function() RETURNS VOID
|
||||
AS '$libdir/timescaledb-mock-5', 'mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '$libdir/timescaledb-mock-5', 'ts_mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
@ -1,4 +1,4 @@
|
||||
CREATE SCHEMA IF NOT EXISTS _timescaledb_cache;
|
||||
CREATE TABLE IF NOT EXISTS _timescaledb_cache.cache_inval_extension();
|
||||
CREATE OR REPLACE FUNCTION mock_function() RETURNS VOID
|
||||
AS '$libdir/timescaledb-mock-broken', 'mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS '$libdir/timescaledb-mock-broken', 'ts_mock_function' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
@ -1,12 +1,12 @@
|
||||
\c single :ROLE_SUPERUSER
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_http_parsing(int) RETURNS VOID
|
||||
AS :MODULE_PATHNAME, 'test_http_parsing' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_http_parsing' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_http_parsing_full() RETURNS VOID
|
||||
AS :MODULE_PATHNAME, 'test_http_parsing_full' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_http_parsing_full' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_http_request_build() RETURNS VOID
|
||||
AS :MODULE_PATHNAME, 'test_http_request_build' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_http_request_build' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_conn() RETURNS VOID
|
||||
AS :MODULE_PATHNAME, 'test_conn' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_conn' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
||||
\c single :ROLE_DEFAULT_PERM_USER
|
||||
SELECT _timescaledb_internal.test_http_parsing(10000);
|
||||
|
@ -1,6 +1,6 @@
|
||||
\c single :ROLE_SUPERUSER
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_privacy() RETURNS BOOLEAN
|
||||
AS :MODULE_PATHNAME, 'test_privacy' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_privacy' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
\c single :ROLE_DEFAULT_PERM_USER
|
||||
|
||||
-- Should be off be default in tests
|
||||
|
@ -1,16 +1,16 @@
|
||||
\c single :ROLE_SUPERUSER
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_status(int) RETURNS JSONB
|
||||
AS :MODULE_PATHNAME, 'test_status' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_status' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_status_ssl(int) RETURNS JSONB
|
||||
AS :MODULE_PATHNAME, 'test_status_ssl' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_status_ssl' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_status_mock(text) RETURNS JSONB
|
||||
AS :MODULE_PATHNAME, 'test_status_mock' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_status_mock' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_telemetry_parse_version(response text, installed_major int, installed_minor int, installed_patch int, installed_modtag text = NULL)
|
||||
RETURNS TABLE(version_string text, major int, minor int, patch int, modtag text, up_to_date bool)
|
||||
AS :MODULE_PATHNAME, 'test_telemetry_parse_version' LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
AS :MODULE_PATHNAME, 'ts_test_telemetry_parse_version' LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_telemetry_main_conn(text, text, text)
|
||||
RETURNS BOOLEAN AS :MODULE_PATHNAME, 'test_telemetry_main_conn' LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_telemetry(host text = NULL, servname text = NULL, port int = NULL) RETURNS JSONB AS :MODULE_PATHNAME, 'test_telemetry' LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
RETURNS BOOLEAN AS :MODULE_PATHNAME, 'ts_test_telemetry_main_conn' LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
CREATE OR REPLACE FUNCTION _timescaledb_internal.test_telemetry(host text = NULL, servname text = NULL, port int = NULL) RETURNS JSONB AS :MODULE_PATHNAME, 'ts_test_telemetry' LANGUAGE C IMMUTABLE PARALLEL SAFE;
|
||||
|
||||
\c single :ROLE_DEFAULT_PERM_USER
|
||||
SELECT _timescaledb_internal.test_status_ssl(200);
|
||||
|
@ -421,7 +421,7 @@ FROM unnest(ARRAY[
|
||||
-------------------------------------
|
||||
\c single :ROLE_SUPERUSER
|
||||
CREATE OR REPLACE FUNCTION test.interval_to_internal(coltype REGTYPE, value ANYELEMENT = NULL::BIGINT) RETURNS BIGINT
|
||||
AS :MODULE_PATHNAME, 'dimension_interval_to_internal_test' LANGUAGE C VOLATILE;
|
||||
AS :MODULE_PATHNAME, 'ts_dimension_interval_to_internal_test' LANGUAGE C VOLATILE;
|
||||
\c single :ROLE_DEFAULT_PERM_USER
|
||||
|
||||
SELECT test.interval_to_internal('TIMESTAMP'::regtype, INTERVAL '1 day');
|
||||
|
@ -257,4 +257,4 @@ $BODY$;
|
||||
|
||||
-- Used to set a deterministic memory setting during tests
|
||||
CREATE OR REPLACE FUNCTION test.set_memory_cache_size(memory_amount text)
|
||||
RETURNS BIGINT AS :MODULE_PATHNAME, 'set_memory_cache_size' LANGUAGE C VOLATILE STRICT;
|
||||
RETURNS BIGINT AS :MODULE_PATHNAME, 'ts_set_memory_cache_size' LANGUAGE C VOLATILE STRICT;
|
||||
|
@ -79,10 +79,10 @@ hypertable_cache_invalidate_callback(void)
|
||||
{
|
||||
}
|
||||
|
||||
TS_FUNCTION_INFO_V1(mock_function);
|
||||
TS_FUNCTION_INFO_V1(ts_mock_function);
|
||||
|
||||
Datum
|
||||
mock_function(PG_FUNCTION_ARGS)
|
||||
ts_mock_function(PG_FUNCTION_ARGS)
|
||||
{
|
||||
elog(WARNING, "mock function call " STR(TIMESCALEDB_VERSION_MOD));
|
||||
PG_RETURN_VOID();
|
||||
|
@ -9,10 +9,10 @@
|
||||
|
||||
#define MAX_RESULT_SIZE 2048
|
||||
|
||||
TS_FUNCTION_INFO_V1(test_conn);
|
||||
TS_FUNCTION_INFO_V1(ts_test_conn);
|
||||
|
||||
Datum
|
||||
test_conn(PG_FUNCTION_ARGS)
|
||||
ts_test_conn(PG_FUNCTION_ARGS)
|
||||
{
|
||||
char response[MAX_RESULT_SIZE];
|
||||
Connection *conn;
|
||||
|
@ -59,9 +59,9 @@ const char *const BAD_RESPONSES[] = {
|
||||
int TEST_LENGTHS[] = {14, 14, 14, 14};
|
||||
const char *MESSAGE_BODY[] = {"{\"status\":200}", "{\"status\":200}", "{\"status\":200}", "{\"status\":201}"};
|
||||
|
||||
TS_FUNCTION_INFO_V1(test_http_parsing);
|
||||
TS_FUNCTION_INFO_V1(test_http_parsing_full);
|
||||
TS_FUNCTION_INFO_V1(test_http_request_build);
|
||||
TS_FUNCTION_INFO_V1(ts_test_http_parsing);
|
||||
TS_FUNCTION_INFO_V1(ts_test_http_parsing_full);
|
||||
TS_FUNCTION_INFO_V1(ts_test_http_request_build);
|
||||
|
||||
static int
|
||||
num_test_strings()
|
||||
@ -71,7 +71,7 @@ num_test_strings()
|
||||
|
||||
/* Check we can succesfully parse partial by well-formed HTTP responses */
|
||||
Datum
|
||||
test_http_parsing(PG_FUNCTION_ARGS)
|
||||
ts_test_http_parsing(PG_FUNCTION_ARGS)
|
||||
{
|
||||
int num_iterations = PG_GETARG_INT32(0);
|
||||
int bytes,
|
||||
@ -117,7 +117,7 @@ test_http_parsing(PG_FUNCTION_ARGS)
|
||||
* successfully find error with full, poorly-formed HTTP responses
|
||||
*/
|
||||
Datum
|
||||
test_http_parsing_full(PG_FUNCTION_ARGS)
|
||||
ts_test_http_parsing_full(PG_FUNCTION_ARGS)
|
||||
{
|
||||
int bytes,
|
||||
i;
|
||||
@ -174,7 +174,7 @@ test_http_parsing_full(PG_FUNCTION_ARGS)
|
||||
}
|
||||
|
||||
Datum
|
||||
test_http_request_build(PG_FUNCTION_ARGS)
|
||||
ts_test_http_request_build(PG_FUNCTION_ARGS)
|
||||
{
|
||||
const char *serialized;
|
||||
size_t request_len;
|
||||
|
@ -7,25 +7,25 @@
|
||||
#include "export.h"
|
||||
#include "telemetry/metadata.h"
|
||||
|
||||
TS_FUNCTION_INFO_V1(test_uuid);
|
||||
TS_FUNCTION_INFO_V1(test_exported_uuid);
|
||||
TS_FUNCTION_INFO_V1(test_install_timestamp);
|
||||
TS_FUNCTION_INFO_V1(ts_test_uuid);
|
||||
TS_FUNCTION_INFO_V1(ts_test_exported_uuid);
|
||||
TS_FUNCTION_INFO_V1(ts_test_install_timestamp);
|
||||
|
||||
Datum
|
||||
test_uuid(PG_FUNCTION_ARGS)
|
||||
ts_test_uuid(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_DATUM(metadata_get_uuid());
|
||||
}
|
||||
|
||||
Datum
|
||||
test_exported_uuid(PG_FUNCTION_ARGS)
|
||||
ts_test_exported_uuid(PG_FUNCTION_ARGS)
|
||||
|
||||
{
|
||||
PG_RETURN_DATUM(metadata_get_exported_uuid());
|
||||
}
|
||||
|
||||
Datum
|
||||
test_install_timestamp(PG_FUNCTION_ARGS)
|
||||
ts_test_install_timestamp(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_DATUM(metadata_get_install_timestamp());
|
||||
}
|
||||
|
@ -8,10 +8,10 @@
|
||||
#include "telemetry/telemetry.h"
|
||||
#include "telemetry/uuid.h"
|
||||
|
||||
TS_FUNCTION_INFO_V1(test_privacy);
|
||||
TS_FUNCTION_INFO_V1(ts_test_privacy);
|
||||
|
||||
Datum
|
||||
test_privacy(PG_FUNCTION_ARGS)
|
||||
ts_test_privacy(PG_FUNCTION_ARGS)
|
||||
{
|
||||
/* This test should only run when timescaledb.telemetry_level=off */
|
||||
PG_RETURN_BOOL(telemetry_main("", "", ""));
|
||||
|
@ -16,11 +16,11 @@
|
||||
#define HTTPS_PORT 443
|
||||
#define TEST_ENDPOINT "postman-echo.com"
|
||||
|
||||
TS_FUNCTION_INFO_V1(test_status);
|
||||
TS_FUNCTION_INFO_V1(test_status_ssl);
|
||||
TS_FUNCTION_INFO_V1(test_status_mock);
|
||||
TS_FUNCTION_INFO_V1(test_telemetry_main_conn);
|
||||
TS_FUNCTION_INFO_V1(test_telemetry);
|
||||
TS_FUNCTION_INFO_V1(ts_test_status);
|
||||
TS_FUNCTION_INFO_V1(ts_test_status_ssl);
|
||||
TS_FUNCTION_INFO_V1(ts_test_status_mock);
|
||||
TS_FUNCTION_INFO_V1(ts_test_telemetry_main_conn);
|
||||
TS_FUNCTION_INFO_V1(ts_test_telemetry);
|
||||
|
||||
#ifdef TS_DEBUG
|
||||
static char *test_string;
|
||||
@ -93,7 +93,7 @@ test_factory(ConnectionType type, int status, char *host, int port)
|
||||
|
||||
/* Test ssl_ops */
|
||||
Datum
|
||||
test_status_ssl(PG_FUNCTION_ARGS)
|
||||
ts_test_status_ssl(PG_FUNCTION_ARGS)
|
||||
{
|
||||
int status = PG_GETARG_INT32(0);
|
||||
#ifdef TS_USE_OPENSSL
|
||||
@ -113,7 +113,7 @@ test_status_ssl(PG_FUNCTION_ARGS)
|
||||
|
||||
/* Test default_ops */
|
||||
Datum
|
||||
test_status(PG_FUNCTION_ARGS)
|
||||
ts_test_status(PG_FUNCTION_ARGS)
|
||||
{
|
||||
int port = 80;
|
||||
int status = PG_GETARG_INT32(0);
|
||||
@ -124,7 +124,7 @@ test_status(PG_FUNCTION_ARGS)
|
||||
#ifdef TS_DEBUG
|
||||
/* Test mock_ops */
|
||||
Datum
|
||||
test_status_mock(PG_FUNCTION_ARGS)
|
||||
ts_test_status_mock(PG_FUNCTION_ARGS)
|
||||
{
|
||||
int port = 80;
|
||||
text *arg1 = PG_GETARG_TEXT_P(0);
|
||||
@ -135,10 +135,10 @@ test_status_mock(PG_FUNCTION_ARGS)
|
||||
}
|
||||
#endif
|
||||
|
||||
TS_FUNCTION_INFO_V1(test_telemetry_parse_version);
|
||||
TS_FUNCTION_INFO_V1(ts_test_telemetry_parse_version);
|
||||
|
||||
Datum
|
||||
test_telemetry_parse_version(PG_FUNCTION_ARGS)
|
||||
ts_test_telemetry_parse_version(PG_FUNCTION_ARGS)
|
||||
{
|
||||
text *response = PG_GETARG_TEXT_P(0);
|
||||
VersionInfo installed_version;
|
||||
@ -196,7 +196,7 @@ test_telemetry_parse_version(PG_FUNCTION_ARGS)
|
||||
|
||||
/* Try to get the telemetry function to handle errors. Never connect to the actual endpoint. Only test cases that will result in connection errors. */
|
||||
Datum
|
||||
test_telemetry_main_conn(PG_FUNCTION_ARGS)
|
||||
ts_test_telemetry_main_conn(PG_FUNCTION_ARGS)
|
||||
{
|
||||
text *host = PG_GETARG_TEXT_P(0);
|
||||
text *path = PG_GETARG_TEXT_P(1);
|
||||
@ -206,7 +206,7 @@ test_telemetry_main_conn(PG_FUNCTION_ARGS)
|
||||
}
|
||||
|
||||
Datum
|
||||
test_telemetry(PG_FUNCTION_ARGS)
|
||||
ts_test_telemetry(PG_FUNCTION_ARGS)
|
||||
{
|
||||
Connection *conn;
|
||||
ConnectionType conntype;
|
||||
|
Loading…
x
Reference in New Issue
Block a user