Previously, each test set their own (although mostly the same)
configuration for log output and error verbosity. This is now set
globally in the test runner so that tests only need to set these
configuration parameters if they need to override the defaults. The
log verbosity is also reduced so that errors aren't generated with the
line number of the source file that output the error. Line numbers in
the output can break tests when upgrading to a new PostgreSQL version
that outputs a different line number.
DROP EXTENSION didn't properly reset caches and other saved state
causing various errors related to bad state when the extension was
dropped and/or recreated later.
This patch adds functionality to track the state of the extension and
also signals DROP EXTENSION to other backends that might be running,
allowing them to reset their internal extension state.
If an error is generated in any of the insert triggers, the insert
state kept during a batch insert might be left in an undefined state,
breaking the next insert. This patch makes sure errors are captured in
the insert triggers so that the state can be cleaned up.
Rename setup_db() and fix port for local connections
Approved-by: Matvey Arye <cevian@gmail.com>
Approved-by: Olof Rensfelt <olof@iobeam.com>
Approved-by: ci-vast
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.
Add query tests for ORDER BY time DESC queries LIMIT queries
Approved-by: ci-vast
Approved-by: enordstr NA <erik.nordstrom@gmail.com>
Approved-by: Olof Rensfelt <olof@iobeam.com>
These tests show that non-aggregated queries that have an ORDER BY time
DESC LIMIT x structure perform well. Postgres processes such queries by
using a time DESC index and then performs a MergeAppend. Some further
optimization to avoid touching unnecessary tables due to constraints
can be added but they are not a priority. Much worse is that these
optimizations do not work when grouping by time (either through
integer division or using date_trunc).
In order to use the non-aggregated query optimizations we had
to create an index with time as the leading field and no
WHERE clause on the index.
Generate object dependencies to force 'make' to recompile on changes to headers
Approved-by: Matvey Arye
Approved-by: Olof Rensfelt
Approved-by: ci-vast
Previously, running 'make' did not recompile source files when changes
were made to header files. Now the compiler generates dependency files
that will pick up changes to header files and recompile any source
files that include the updated header.
Also, remove insert.h, which is not needed.
This patch refactors the source code so that a bunch of unrelated code
for the planner, process utilities and transaction management, which
was previously located in the common file timescaledb.c, is now broken
up into separate source files.
The hypertable cache stores negative cache entries to speed up checks
for tables that aren't hypertables. However, a full hypertable cache
entry was allocated for these negative entries, thus wasting cache
storage. With this update, the full entry is only allocated for
positive entries that actually represent hypertables.