mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-16 10:33:27 +08:00
Change `add_data_node` so that host parameter is required. If the host parameter is not provided, or is `NULL`, an error will be printed. Also change logic for how the default value for `port` is picked. Now it will by default use the port given in the configuration file. The commit update all the result files, add the `host` parameter to all calls of `add_data_node` and add a few tests to check that an error is given when `host` is not provided.
29 lines
979 B
SQL
29 lines
979 B
SQL
-- This file and its contents are licensed under the Timescale License.
|
|
-- Please see the included NOTICE for copyright information and
|
|
-- LICENSE-TIMESCALE for a copy of the license.
|
|
|
|
\c :TEST_DBNAME :ROLE_SUPERUSER
|
|
|
|
CREATE FUNCTION _timescaledb_internal.test_remote_connection_cache()
|
|
RETURNS void
|
|
AS :TSL_MODULE_PATHNAME, 'tsl_test_remote_connection_cache'
|
|
LANGUAGE C STRICT;
|
|
|
|
CREATE FUNCTION _timescaledb_internal.test_alter_data_node(node_name NAME)
|
|
RETURNS BOOL
|
|
AS :TSL_MODULE_PATHNAME, 'tsl_test_alter_data_node'
|
|
LANGUAGE C STRICT;
|
|
|
|
DO $d$
|
|
BEGIN
|
|
EXECUTE $$SELECT add_data_node('loopback_1', host => 'localhost',
|
|
database => 'loopback_1',
|
|
port => current_setting('port')::int)$$;
|
|
EXECUTE $$SELECT add_data_node('loopback_2', host => 'localhost',
|
|
database => 'loopback_2',
|
|
port => current_setting('port')::int)$$;
|
|
END;
|
|
$d$;
|
|
|
|
SELECT _timescaledb_internal.test_remote_connection_cache();
|