timescaledb/test/sql/ddl_single.sql
Erik Nordström 036c40886c Simplify cluster setup
Setting up single node is now:

```
CREATE EXTENSION IF NOT EXISTS iobeamdb CASCADE;
select setup_single_node();
```

To setup a cluster do (on meta node):
```
CREATE EXTENSION IF NOT EXISTS iobeamdb CASCADE;
select set_meta();
```

on data node:
```
CREATE EXTENSION IF NOT EXISTS iobeamdb CASCADE;
select join_cluster('metadb', 'metahost');
```

This assumes that the commands are issued by the same user on both the
meta node and the data node. Otherwise the data node also has to
specify the user name to use when connecting to the meta node.
2017-02-07 12:22:36 +01:00

25 lines
483 B
SQL

\set ON_ERROR_STOP 1
\set VERBOSITY verbose
\set SHOW_CONTEXT never
\o /dev/null
\ir include/create_single_db.sql
\o
\set ECHO ALL
\c single
\ir include/ddl_ops_1.sql
SELECT * FROM PUBLIC."Hypertable_1";
EXPLAIN SELECT * FROM PUBLIC."Hypertable_1";
SELECT * FROM _iobeamdb_catalog.default_replica_node;
\ir include/ddl_ops_2.sql
\d+ PUBLIC."Hypertable_1"
\d+ "_iobeamdb_internal"."_hyper_1_root"
\d+ _iobeamdb_internal._hyper_1_1_0_1_data
SELECT * FROM PUBLIC."Hypertable_1";