mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-16 02:23:49 +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: - generate_uuid() - get_git_commit() - get_os_info() - tsl_loaded()
15 lines
743 B
SQL
15 lines
743 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.
|
|
|
|
CREATE OR REPLACE FUNCTION _timescaledb_functions.generate_uuid() RETURNS UUID
|
|
AS '@MODULE_PATHNAME@', 'ts_uuid_generate' LANGUAGE C VOLATILE STRICT;
|
|
|
|
-- Insert uuid and install_timestamp on database creation. Don't
|
|
-- create exported_uuid because it gets exported and installed during
|
|
-- pg_dump, which would cause a conflict.
|
|
INSERT INTO _timescaledb_catalog.metadata
|
|
SELECT 'uuid', _timescaledb_functions.generate_uuid(), TRUE ON CONFLICT DO NOTHING;
|
|
INSERT INTO _timescaledb_catalog.metadata
|
|
SELECT 'install_timestamp', now(), TRUE ON CONFLICT DO NOTHING;
|