timescaledb/scripts/out_of_order_random_direct.sql
Sven Klemm 0a66bdb8d3 Move functions to _timescaledb_functions schema
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:

- to_unix_microseconds(timestamptz)
- to_timestamp(bigint)
- to_timestamp_without_timezone(bigint)
- to_date(bigint)
- to_interval(bigint)
- interval_to_usec(interval)
- time_to_internal(anyelement)
- subtract_integer_from_now(regclass, bigint)
2023-08-21 15:01:35 +02:00

19 lines
650 B
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.
DROP DATABASE IF EXISTS test;
CREATE DATABASE test;
\c test
\timing
DROP EXTENSION IF EXISTS timescaledb CASCADE;
CREATE EXTENSION timescaledb;
SELECT pg_backend_pid();
CREATE TABLE test_hyper (i bigint, j double precision, k bigint, ts timestamp);
SELECT create_hypertable('test_hyper', 'i', chunk_time_interval=>10);
INSERT INTO test_hyper SELECT random()*100, random()*100, x*10, _timescaledb_functions.to_timestamp(x) FROM generate_series(1,100000000) AS x;