408 Commits

Author SHA1 Message Date
Matvey Arye
fc4ddd65b5 Fix bug with dropping chunks on tables with indexes 2017-05-20 15:54:46 -04:00
Matvey Arye
32215ff6c5 Add default indexes for hypertables
Changed create_hypertable to add time DESC and partitioning_column, time DESC
indexes by default (the latter only if partitioning column not null).
Indexes only created if there is no index on time and
partitioning_column, time respectively. Index creation can be turned off
with the create_default_indexes parameter to create_hypertable (default true).
2017-05-20 15:54:46 -04:00
Matvey Arye
b2900f9f85 Disable query optimization on regular tables (non-hypertables)
This PR disables query optimizations on regular tables by default.
The option timescaledb.optimize_plain_tables = 'on' enables them
again. timescaledb.disable_optimizations = 'on' disables all
optimizations (note the change from 'true' to 'on').
2017-05-20 15:31:47 -04:00
Rob Kiefer
75fc21ef9f Cleanup sql/timescaledb--*.sql files on make clean
Old versions of the extension sql files could hang around
bloating package sizes if not caught.
2017-05-18 10:30:08 -04:00
Matvey Arye
f227db4b52 Fixes command tag return for COPY on hypertables.
Previously, COPY on hypertables always returned 'COPY 0' in the
command tag. Now, returns the correct count. Fixes #40.
2017-05-16 16:43:47 -04:00
Solar Olugebefola
1ab3c634cc Fix typos 2017-05-16 10:28:36 -04:00
Matvey Arye
eb32081085 Fix Invalid database ID error
This fixes a superfluous error that happened during cache invalidation.
2017-05-16 09:56:00 -04:00
Matvey Arye
662be94d69 Add the first(value, time),last(value, time) aggregates
Add the first and last aggregate functions, which allows for getting
the first and last value, by time, per group. Addresses issue #30.
2017-05-16 09:46:49 -04:00
Matvey Arye
384a8fb0d1 Add regression tests for deleted unit tests 2017-05-16 09:04:13 -04:00
Matvey Arye
31ee92a6ee Remove unit tests and sql/setup
Remove unit tests because most of our testing is in regression tests
anyway and regression tests are better integrated with the Postgres
extension workflow. sql/setup scripts were old and not used except
for unit testing.
2017-05-16 09:04:13 -04:00
Olof Rensfelt
13d3acbcfa Fix bug with alter table add/drop column if exists
Previously, an ALTER TABLE ADD COLUMN IF NOT EXISTS on a hypertable
caused an error if the column already did exist. The reversed problem
with DROP COLUMN is also fixed. Resolves issue #42.
2017-05-15 21:21:33 +02:00
Matvey Arye
f960c24cd4 Fix bug with querying a row as a composite type
Previously a query like `SELECT "1dim" FROM "1dim"` on a hypertable would
fail since the change_table_walker did not properly change the types on
whole row vars. That is now fixed.
2017-05-12 13:39:39 -04:00
Rob Kiefer
236d5fed53 Release 0.0.10-beta and add CHANGELOG 0.0.10-beta 2017-05-04 12:43:19 -04:00
Olof Rensfelt
1c4868d754 Add documentation for chunk_time_interval argument 2017-05-04 12:20:27 -04:00
Matvey Arye
55fd2f2f00 Fixes command tag return for INSERTS on hypertables.
Previously, an INSERT on a hypertable would always return
INSERT 0 0 as the command tag. This makes it return the proper
number of items inserted for the second number. Fixes #28.
2017-05-04 11:55:17 -04:00
Matvey Arye
48ea4330d5 Run pgindent 2017-05-03 18:18:35 -04:00
Matvey Arye
48eb6fdaee Merged in add-time-bucket (pull request #148)
Add time_bucket functions

Approved-by: Olof Rensfelt <olof@iobeam.com>
Approved-by: Erik Nordström <erik.nordstrom@gmail.com>
Approved-by: ci-timescale <erik@timescale.com>
2017-05-03 19:47:37 +00:00
Matvey Arye
c3f930f6c8 Add time_bucket functions
Adds functions to bucket timestamps. These functions are more
powerful versions of date_trunc, since they can take arbitrary
intervals.
2017-05-03 15:40:49 -04:00
Matvey Arye
b128ac2a87 Fix bug with INSERT INTO...SELECT
Previously, INSERT INTO...SELECT FROM hypertable was broken. This was
caused by incorrectly tracking the commandType in change_name_walker.
Fixes #24.
2017-05-03 13:37:23 -04:00
Matvey Arye
e20edf890c Add better error checking for index creation.
This PR adds more regression tests for index creation and tests for more
user-errors. Significantly, it checks for the presence of both the time
and spaced-partition columns in unique indexes. This is needed because
Timescale cannot guarantee uniqueness if colliding rows don't land in the
same chunk. Fixes #29.
2017-05-03 13:21:32 -04:00
Robin Thomas
7b2097a975 ran pgindent successfully with local typedefs; ended up correcting
several code style discrepancies from master.
2017-04-29 18:32:07 -04:00
Robin Thomas
72f754a576 use PostgreSQL's own hash_any function as default partfunc;
remove all murmur3-related source code. Alter regression tests
to reflect new hash values for inputs, and a slightly different
set of input data to ensure that sufficient chunks and partitions
are tested. Some changes to .sh scripts in sql/setup that seem
to be used only to power the "unit tests", which I cannot
yet run successfully.
2017-04-29 18:31:44 -04:00
RobAtticus NA
035cfc9f72 Merged in remove-chunk-limitation (pull request #152)
Remove limitation regarding big COPY.

Approved-by: ci-timescale <erik@timescale.com>
Approved-by: Matvey Arye <cevian@gmail.com>
Approved-by: Olof Rensfelt <olof@iobeam.com>
2017-04-28 15:16:26 +00:00
Rob Kiefer
79946ca2ec Remove limitation regarding big COPY.
With the introduction of fixed-time chunks, this limitation no longer
applies.
2017-04-28 11:16:10 -04:00
Erik Nordström
fd93b68656 Merged in enordstr/backend-database/enordstr/add-emacs-dir-locals-el (pull request #146)
Add PostgreSQL's .dir-locals.el style file

Approved-by: Olof Rensfelt <olof@iobeam.com>
Approved-by: ci-timescale <erik@timescale.com>
Approved-by: Matvey Arye <cevian@gmail.com>
2017-04-28 14:24:19 +00:00
Erik Nordström
88be5e8e06 Add PostgreSQL's .dir-locals.el style file
This adds the .dir-locals.el Emacs style settings file from the
PostgreSQL source. This will make it easier for Emacs users to
conform to the official PostgreSQL coding style.
2017-04-28 13:43:32 +02:00
RobAtticus NA
a037418aaf Merged in update-sample (pull request #151)
Remove sample data instructions and point to docs site

Approved-by: ci-timescale <erik@timescale.com>
Approved-by: Solar Olugebefola <solar@iobeam.com>
2017-04-26 20:39:35 +00:00
Rob Kiefer
39f4c0fd6e Remove sample data instructions and point to docs site
This commit directs users to our docs site for using sample data
so we don't have to keep both places in sync.
2017-04-26 13:22:07 -04:00
Michael Randers-Pehrson
00d3325d6f Added spaces
Adding a few spaces to make it consistent with the rest of the SQL.
2017-04-25 17:26:04 -04:00
banderson
9015314987 Revised the get_general_index_definition function to handle cases where indexes have definitions other than just 'CREATE INDEX' 2017-04-25 17:14:25 -04:00
Rob Kiefer
1c5b2f96a5 Release 0.0.9-beta 0.0.9-beta 2017-04-24 19:47:14 -04:00
Mike Freedman
90ef6c171b Merged in link-cla (pull request #150)
Add link to CLA

Approved-by: ci-timescale <erik@timescale.com>
Approved-by: RobAtticus NA <rob.kiefer@gmail.com>
2017-04-24 14:32:16 +00:00
Michael J. Freedman
a7cbff7050 Add link to CLA 2017-04-24 10:31:56 -04:00
Olof Rensfelt
d070514f2a Fixed time chunk ranges.
To allow better caching and reduce the need for locking, chunks now
have fixed start and stop times set when the chunk is created.
2017-04-23 19:45:46 -04:00
Lacey Powers
305562dea0 Adding #elif defined(__FreeBSD__) to allow building of timescaledb under FreeBSD 11. 2017-04-23 12:19:34 -04:00
Rob Kiefer
ecb5d617da Release 0.0.8-beta 0.0.8-beta 2017-04-20 12:10:45 -04:00
Erik Nordström
a92802e599 Merged in enordstr/backend-database/enordstr/style-guide (pull request #147)
Add code style guide

Approved-by: Mike Freedman <mfreed@cs.princeton.edu>
Approved-by: RobAtticus NA <rob.kiefer@gmail.com>
Approved-by: ci-timescale <erik@timescale.com>
2017-04-20 14:39:55 +00:00
Erik Nordström
d27462e23f Add code style guide
This code style doc adds information about code style and formatting
as well as information on tools and editors.
2017-04-20 15:04:29 +02:00
Rob Kiefer
a79a6caffd Fix a mistake in the docker run command 2017-04-20 09:02:50 -04:00
RobAtticus NA
ed06f0a36e Merged in docker-instructions (pull request #149)
Add instructions to run Docker image.

Approved-by: Matvey Arye <cevian@gmail.com>
Approved-by: Ajay Kulkarni <ajay@iobeam.com>
Approved-by: ci-timescale <erik@timescale.com>
2017-04-20 02:40:16 +00: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
Mike Freedman
515f2016fc Merged in contributors (pull request #145)
Add contribution instructions

Approved-by: Erik Nordström <erik.nordstrom@gmail.com>
Approved-by: ci-timescale <erik@timescale.com>
Approved-by: RobAtticus NA <rob.kiefer@gmail.com>
2017-04-19 14:20:40 +00:00
Michael J. Freedman
367ada624e Add contribution instructions 2017-04-19 10:19:20 -04:00
Matvey Arye
7debe76ec3 Merged in add-copy-from-test (pull request #143)
Add test for COPY TO

Approved-by: Erik Nordström <erik.nordstrom@gmail.com>
Approved-by: ci-timescale <erik@timescale.com>
2017-04-12 16:57:17 +00:00
Matvey Arye
b134cdffd8 Add test for COPY TO 2017-04-12 12:53:58 -04:00
Matvey Arye
f975acd991 Merged in remove-dblink (pull request #142)
Remove dblink dependency.

Approved-by: Erik Nordström <erik.nordstrom@gmail.com>
Approved-by: ci-timescale <erik@timescale.com>
2017-04-12 16:43:19 +00: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
6142d94d41 Release 0.0.7-beta (fix bugs in tests) 0.0.7-beta 2017-04-06 12:15:53 -04:00
Rob Kiefer
d59b5a4d53 Remove all usage of hstore 2017-04-06 12:14:47 -04:00
Rob Kiefer
7d6c91b2e6 Release 0.0.6-beta 0.0.6-beta 2017-04-06 11:32:21 -04:00