During dropping of the database used in the various tests
we can encounter an error if something is still connected
to the database, making the output unpredicatable. This
change should reduce the possibility of that happening.
The normal Postgres detoasting code locks and opens toast tables and
indexes for each toast value, which can take a large percentage CPU time
on simple queries. Since in decompression we're working with one table
at a time, the toast table and index are the same for every datum, so we
don't have to redo this work.
Since all SQLValueFunction are STABLE we can safely push them
down into the scan of the compressed chunk.
The following expressions are pushed down:
- CURRENT_DATE
- CURRENT_TIME
- CURRENT_TIME(p)
- CURRENT_TIMESTAMP
- CURRENT_TIMESTAMP(p)
- LOCALTIME
- LOCALTIME(p)
- LOCALTIMESTAMP
- LOCALTIMESTAMP(p)
- USER
- CURRENT_USER
- SESSION_USER
- CURRENT_CATALOG
- CURRENT_SCHEMA
Before this patch we required the user to have select permissions
on the compressed chunks in addition to permissions on the hypertable.
This patch changes our code to not require permission on the
compressed chunk when querying through the uncompressed hypertable
or chunk similar to how we handle this on PG < 16.
This fixes views with security_barrier that have constraints
on the user.
Fixes: #6425
Prior to version 2.8, compressed chunks had a different format
for indexing. This change attempts to find the best index
it can actually use during scanning of compressed data
and moves filters around based on the selected index. If
no index exists, it should fallback to doing a sequencial
scan.
Before this change during downgrade script generation we would
always fetch the pre-update script from the previous version and
prepend it to the generated scripts. This limits what can be
referenced in the pre-update script and also what is possible
within the downgrade itself.
This patch splits the pre-update script into a generic part that
is used for update/downgrade and an update specific part. We could
later also add a downgrade specific part but currently it is not
needed. This change is necessary because we reference a timescaledb
view in the pre-update script which prevents changes to that view.
Remove the code used by multinode to handle remote connections.
This patch completely removes tsl/src/remote and any remaining
distributed hypertable checks.
The update test fails on PG13 on the statement
`\d+ cagg_joins_upgrade_test_with_realtime_using` with
the error message `ERROR: invalid memory alloc request size 13877216128`.
To unblock CI and allow other PRs to get merged we temporarily
skip the offending query on PG13.
The latest OpenSSL 3.2.0 version has known issues with Postgres. MacOSX
CI runs were failing because of this. We now use macos-13 visavis the
earlier macos-11. That seems to solve this OpenSSL issue.
With PG16, group pathkeys can include column which are
not in the GROUP BY clause when dealing with ordered
aggregates. This means we have to exclude those columns
when checking and creating the gapfill custom scan subpath.
Fixes#6396
Direct access of the `.data` member of `NameData` structures are
discuraged and `NameStr` should be used instead.
Also adding one instance that was missed in #5336.
This patch drops the catalog table _timescaledb_catalog.hypertable_compression
and stores those settings in _timescaledb_catalog.compression_settings instead.
The storage format is changed and the new table will have 1 entry per relation
instead of 1 entry per column and has no dependancy on hypertables.
All other aspects of compression will remain the same. This is refactoring is
to enable per chunk compression settings in a follow-up patch.
Refactor the compression code to only use the table scan API when
scanning relations instead of a mix of the table and heap scan
APIs. The table scan API is a higher-level API and recommended as it
works for any type of relation and uses table slots directly, which
means that in some cases a full heap tuple need not be materialized.
The previous multinode PR only removes the regression test,
isolation test and TAP test files but not the C files. This patch
also removes the deparse test which was missed in the previous
PR.
This PR adds capabilities to allow individual PRs to override the
loader-change check. Not all changes in the loader directories
will require a new loader version so the check can sometimes have
false positives. It also mentions to bump loader version for
loader changes.
We used a mixture of include guards and pragma once in our header
files. This patch changes our headers to always use pragma once
because it is less error prone, can be copy/pasted, doesnt require
a unique identifier and is also shorter.