timescaledb/tsl/test/sql/remote_connection_cache.sql
Mats Kindahl 6e9f644714 Require host parameter in add_data_node
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.
2020-05-27 17:31:09 +02:00

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();