28 Commits

Author SHA1 Message Date
Erik Nordström
3192c8a6bf Remove Dockerfile and docker.mk
Release Docker builds are now provided in a separate repository,
https://github.com/timescale/timescaledb-docker.

Tests and development builds for Docker are now provided
by two new scripts in the scripts directory:

- `docker-build.sh` to build a development image from current sources.
- `docker-run-tests.sh` to run tests for current sources through a Docker container.
2017-06-19 22:30:46 +02:00
Matvey Arye
bfe58b61f7 Refactor towards supporting version upgrades
Clean up the table schema to get rid of legacy tables and functionality
that makes it more difficult to provide an upgrade path.

Notable changes:
* Get rid of legacy tables and code
* Simplify directory structure for SQL code
* Simplify table hierarchy: remove root table and make chunk tables
* inherit directly from main table
* Change chunk table suffix from _data to _chunk
* Simplify schema usage: _timescaledb_internal for internal functions.
* _timescaledb_catalog for metadata tables.
* Remove postgres_fdw dependency
* Improve code comments in sql code
2017-06-08 13:55:05 -04:00
Matvey Arye
cedcafc959 Remove setup_timescaledb() and fix pg_dump/pg_restore.
This PR removes the need to run setup_timescaledb. It also fixes
pg_dump and pg_restore. Previously, the database would restore in
a broken state because trigger functions were never attached to
meta tables (since setup_timescaledb() was not run). However, attaching
those triggers at extension creation also causes problems since the data
copy happens after extension creation but we don't want triggers fired
on the data restored (that could cause duplicate rows, for example).

The solution to this chicken-and-egg problem in this PR is to have
a special configuration (GUC) variable `timescaledb.restoring` that,
if 'on', would prevent the extension from attaching triggers at
extension creation. Then, after restoration, you'd call
restore_timescaledb() to attach the triggers and unset the GUC above.
This procedure is documented in the README as part of this PR.
2017-05-22 16:12:21 -04:00
Rob Kiefer
9e3bafc2f4 Add instructions to run Docker image.
This commit adds an example how to run the Docker image so the
data is persisted between restarts based on our docker-run.sh
script. It also fixes a typo in the docker-run.sh script where
the default DATA_DIR was not correctly set.
2017-04-19 21:05:37 -04:00
Matvey Arye
a78f1570ba Remove dblink dependency.
The dblink extension is blacklisted by some cloud-hosting providers and
is an unnecessary dependency for single-node operation. Since we don't plan
to use dblink to implement clustering this PR removes the dependency.
2017-04-12 11:14:54 -04:00
Rob Kiefer
cb90eef350 Rename setup_db() and fix port for local connections
If a user attempts to setup a database while not connecting using
the network, port is NULL and thus fails constraint checks. Instead,
we now use the default Postgres port of 5432 when this happens.

Also, setup_db() is renamed to setup_timescaledb() for clarity in
the presence of other extensions.
2017-03-22 09:26:03 -04:00
Erik Nordström
b4c9055184 Move generate_typedef.sh to scripts directory 2017-03-16 10:48:21 +01:00
Rob Kiefer
55736b9262 Add a migrate data script for large datasets
Currently TimescaleDB does not close chunks mid-insert, so large
batches will overfill a chunk. This commit adds a script to
split large CSV files into smaller batches to allow reasonable
closing of chunks.
2017-03-10 11:41:11 -05:00
Rob Kiefer
3760993519 Renames setup_single_node() to setup_db() 2017-03-06 15:36:29 -05:00
Erik Nordström
11938ebb08 Default to asking for number of partitions when partitioning column set.
Since create_hypertable() allows you to optionally specify a
partitioning column, it makes sense to default to one partition when
no column is specified and asking for the number of partitions when a
column is specified and the number of partitions is not (instead of
defaulting to one).

This patch also changes the order and type of partitioning-related
input arguments to create_hypertable() so that the number of
partitions can easily be specified alongside the partitioning column
and without type casting.
2017-03-06 20:26:02 +01:00
Rob Kiefer
ee3ad4678d Rename iobeamdb to TimescaleDB 2017-03-06 11:06:49 -05:00
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
Rob Kiefer
a2198b7c72 Initial draft of sample docs. Update README 2017-02-02 12:44:25 -05:00
Rob Kiefer
574d6202cd Add bash script for setting up single-node cluster with user-defined DB name 2017-02-01 16:03:24 -05:00
Matvey Arye
d3a3670aa6 Merged in install-nits (pull request #71)
nit to installation/docker
2017-01-31 22:03:14 +00:00
Erik Nordström
7b94c573ba Refactor directory structure and tests
- Directory structure now matches common practices
- Regression tests now run with pg_regress via the PGXS infrastructure.
- Unit tests do not integrate well with pg_regress and have to be run
  separately.
- Docker functionality is separate from main Makefile. Run with
  `make -f docker.mk` to build and `make -f docker.mk run` to run
  the database in a container.
2017-01-31 20:14:19 +01:00
Olof Rensfelt
b919df869f runs test docker om different port 2017-01-31 13:04:27 +01:00
Erik Nordström
8abc301e51 Add support for tablespaces
Identically named tablespaces need to exist on each data node before
a hypertable is created from a table that references a tablespace.
2017-01-31 10:38:01 +01:00
Matvey Arye
97205a7cec Misc usability fixes 2017-01-24 17:26:57 -05:00
Matvey Arye
ce5e1aecd7 Changes to Makefile and associated scripts to make docker commands act as expected + to mount a data volume 2017-01-24 14:59:54 -05:00
Rob Kiefer
29bc320cfb Add Getting Started instructions to README 2017-01-19 14:53:38 -05:00
Matvey Arye
64526426c5 Allow single-node deployments that use one database.
Allowing database deployments that use the same database for both the
meta and node roles simplifies operations when iobeamdb is deployed on
a single-node. It allows the database to operate without any
cross-network communication (either through dblink or postgres_fdw) and
thus offers stronger consistency guarantees.
2017-01-18 19:03:53 -05:00
Rob Kiefer
0ec5095cf5 Cleanup Makefile targets, script names, and README 2017-01-16 10:49:08 -05:00
Erik Nordström
a27f71b614 Rename add_hypertable() -> create_hypertable() 2017-01-16 14:45:15 +01:00
Matvey Arye
228b8eeab7 handle dblink correctlty for meta->data too 2017-01-13 13:25:46 -05:00
Matvey Arye
94ab3b95d6 Upadting docs 2016-12-23 16:21:01 -05:00
Matvey Arye
490019d20b Use C parse-tree modifications to transform queries on main tables to that on replica tables 2016-12-23 14:32:45 -05:00
Olof Rensfelt
0f3aa8d557 * Add _meta schema to allow all code to be loaded on both meta and nodes.
* Split SQL into functions and setup.
* Remove hash-lib dependency.
* Makes code into Postgresql extension.
2016-12-20 16:10:59 +01:00