Skip to content

Commit c049edd

Browse files
authored
Merge branch 'main' into allow_custom_uda_name
2 parents db3be1a + 2a3d5d9 commit c049edd

File tree

87 files changed

+1154
-284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1154
-284
lines changed

.github/workflows/apt-arm-packages.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ jobs:
7070
id: versions
7171
run: |
7272
# read expected version from version.config
73-
# version will only be a proper version in a release branch so we use update_from_version
73+
# version will only be a proper version in a release branch so we use previous_version
7474
# as fallback for main
7575
if grep '^version = [0-9.]\+$' version.config; then
7676
version=$(grep '^version = ' version.config | sed -e 's!^version = !!')
7777
else
78-
version=$(grep '^update_from_version = ' version.config | sed -e 's!^update_from_version = !!')
78+
version=$(grep '^previous_version = ' version.config | sed -e 's!^previous_version = !!')
7979
fi
8080
echo "version=${version}" >>$GITHUB_OUTPUT
8181

.github/workflows/apt-packages.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ jobs:
6464
id: versions
6565
run: |
6666
# read expected version from version.config
67-
# version will only be a proper version in a release branch so we use update_from_version
67+
# version will only be a proper version in a release branch so we use previous_version
6868
# as fallback for main
6969
if grep '^version = [0-9.]\+$' version.config; then
7070
version=$(grep '^version = ' version.config | sed -e 's!^version = !!')
7171
else
72-
version=$(grep '^update_from_version = ' version.config | sed -e 's!^update_from_version = !!')
72+
version=$(grep '^previous_version = ' version.config | sed -e 's!^previous_version = !!')
7373
fi
7474
echo "version=${version}" >>$GITHUB_OUTPUT
7575

.github/workflows/docker-images.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ jobs:
5353
id: versions
5454
run: |
5555
# read expected version from version.config
56-
# version will only be a proper version in a release branch so we use update_from_version
56+
# version will only be a proper version in a release branch so we use previous_version
5757
# as fallback for main
5858
if grep '^version = [0-9.]\+$' version.config; then
5959
version=$(grep '^version = ' version.config | sed -e 's!^version = !!')
6060
else
61-
version=$(grep '^update_from_version = ' version.config | sed -e 's!^update_from_version = !!')
61+
version=$(grep '^previous_version = ' version.config | sed -e 's!^previous_version = !!')
6262
fi
6363
echo "version=${version}" >>$GITHUB_OUTPUT
6464

.github/workflows/homebrew.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
if grep '^version = [0-9.]\+$' version.config; then
5353
version=$(grep '^version = ' version.config | sed -e 's!^version = !!')
5454
else
55-
version=$(grep '^update_from_version = ' version.config | sed -e 's!^update_from_version = !!')
55+
version=$(grep '^previous_version = ' version.config | sed -e 's!^previous_version = !!')
5656
fi
5757
installed_version=$(psql -X -t \
5858
-c "SELECT extversion FROM pg_extension WHERE extname='timescaledb';" \

.github/workflows/pg_ladybug.yaml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: pg_ladybug
2+
"on":
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
- prerelease_test
8+
jobs:
9+
pg_ladybug:
10+
runs-on: ubuntu-latest
11+
env:
12+
CC: clang-19
13+
CXX: clang++-19
14+
LLVM_CONFIG: llvm-config-19
15+
16+
steps:
17+
18+
- name: Install dependencies
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get purge llvm-16 llvm-18 clang-16 clang-18
22+
sudo apt-get install llvm-19 llvm-19-dev clang-19 libclang-19-dev clang-tidy-19 libcurl4-openssl-dev postgresql-server-dev-16
23+
sudo ln -sf /usr/bin/clang-tidy-19 /usr/bin/clang-tidy
24+
25+
- name: Checkout timescaledb
26+
uses: actions/checkout@v4
27+
28+
- name: Checkout pg_ladybug
29+
uses: actions/checkout@v4
30+
with:
31+
repository: 'timescale/pg_ladybug'
32+
path: 'pg_ladybug'
33+
ref: '0.1.0'
34+
35+
- name: build pg_ladybug
36+
run: |
37+
cd pg_ladybug
38+
cmake -S . -B build
39+
make -C build
40+
sudo make -C build install
41+
42+
- name: Verify pg_ladybug
43+
run: |
44+
clang-tidy --load /usr/local/lib/libPostgresCheck.so --checks='-*,postgres-*' --list-checks | grep postgres
45+
46+
- name: Configure timescaledb
47+
run: |
48+
./bootstrap -DCMAKE_BUILD_TYPE=Debug -DLINTER=ON -DCLANG_TIDY_EXTRA_OPTS=",-*,postgres-*;--load=/usr/local/lib/libPostgresCheck.so"
49+
50+
- name: Build timescaledb
51+
run: |
52+
make -C build
53+

.github/workflows/pgspot.yaml

+8-13
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,10 @@ jobs:
5353
5454
- name: Build timescaledb sqlfiles
5555
run: |
56-
downgrade_to=$(grep '^downgrade_to_version = ' version.config | sed -e 's!^[^=]\+ = !!')
56+
previous_version=$(grep '^previous_version = ' version.config | sed -e 's!^[^=]\+ = !!')
5757
git fetch --tags
5858
./bootstrap -DGENERATE_DOWNGRADE_SCRIPT=ON
59-
# We use downgrade_to_version instead of update_from_version because
60-
# when the release PR for a new version has been merged to main but
61-
# the version is not tagged yet update_from_version will not exist yet.
62-
# In all other situations update_from_version and downgrade_to_version
63-
# should point to the same version.
64-
git checkout ${downgrade_to}
59+
git checkout ${previous_version}
6560
make -C build sqlfile sqlupdatescripts
6661
git checkout ${GITHUB_SHA}
6762
make -C build sqlfile sqlupdatescripts
@@ -70,19 +65,19 @@ jobs:
7065
- name: Run pgspot
7166
run: |
7267
version=$(grep '^version = ' version.config | sed -e 's!^[^=]\+ = !!')
73-
downgrade_to=$(grep '^downgrade_to_version = ' version.config | sed -e 's!^[^=]\+ = !!')
68+
previous_version=$(grep '^previous_version = ' version.config | sed -e 's!^[^=]\+ = !!')
7469
7570
# Show files used
76-
ls -la build/sql/timescaledb--${version}.sql build/sql/timescaledb--${downgrade_to}--${version}.sql \
77-
build/sql/timescaledb--${version}--${downgrade_to}.sql
71+
ls -la build/sql/timescaledb--${version}.sql build/sql/timescaledb--${previous_version}--${version}.sql \
72+
build/sql/timescaledb--${version}--${previous_version}.sql
7873
7974
# The next pgspot execution tests the installation script by itself
8075
pgspot ${{ env.PGSPOT_OPTS }} build/sql/timescaledb--${version}.sql
8176
# The next pgspot execution tests the update script to the latest version
8277
# we prepend the installation script here so pgspot can correctly keep track of created objects
83-
pgspot ${{ env.PGSPOT_OPTS }} -a build/sql/timescaledb--${downgrade_to}.sql \
84-
build/sql/timescaledb--${downgrade_to}--${version}.sql
78+
pgspot ${{ env.PGSPOT_OPTS }} -a build/sql/timescaledb--${previous_version}.sql \
79+
build/sql/timescaledb--${previous_version}--${version}.sql
8580
# The next pgspot execution tests the downgrade script to the previous version
8681
# we prepend the installation script here so pgspot can correctly keep track of created objects
8782
pgspot ${{ env.PGSPOT_OPTS }} -a build/sql/timescaledb--${version}.sql \
88-
build/sql/timescaledb--${version}--${downgrade_to}.sql
83+
build/sql/timescaledb--${version}--${previous_version}.sql

.github/workflows/rpm-packages.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ jobs:
7171
id: versions
7272
run: |
7373
# read expected version from version.config
74-
# version will only be a proper version in a release branch so we use update_from_version
74+
# version will only be a proper version in a release branch so we use previous_version
7575
# as fallback for main
7676
if grep '^version = [0-9.]\+$' version.config; then
7777
version=$(grep '^version = ' version.config | sed -e 's!^version = !!')
7878
else
79-
version=$(grep '^update_from_version = ' version.config | sed -e 's!^update_from_version = !!')
79+
version=$(grep '^previous_version = ' version.config | sed -e 's!^previous_version = !!')
8080
fi
8181
echo "version=${version}" >>$GITHUB_OUTPUT
8282

.github/workflows/windows-packages.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ jobs:
5757
- name: Get version
5858
id: version
5959
run: |
60-
# version will only be a proper version in a release branch so we use update_from_version
60+
# version will only be a proper version in a release branch so we use previous_version
6161
# as fallback for main
6262
if (grep '^version = [0-9.]\+$' version.config)
6363
{
6464
$version=sed -n 's!^version = !!p' version.config
6565
} else {
66-
$version=sed -n 's!^update_from_version = !!p' version.config
66+
$version=sed -n 's!^previous_version = !!p' version.config
6767
}
6868
cat version.config
6969
echo "Determined version: "

.unreleased/pr_7880

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Implements: #7880 Add experimental support for window functions in caggs

.unreleased/pr_7912

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixes: #7912 Don't capture errors estimating time max spread

.unreleased/pr_7915

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Implements: #7915 New option `refresh_newest_first` to CAgg refresh policy API

.unreleased/pr_7929

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Implements: #7929 Add CREATE TABLE ... WITH API for creating hypertables

.unreleased/pr_7935

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixes: #7935 Fix TAM segfault on DELETE using segmentby column

.unreleased/pr_7954

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixes: #7954 Allow scheduler restarts to be disabled

CMakeLists.txt

+8-6
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,20 @@ if(VERSION_CONFIG
7676
endif()
7777
endif()
7878

79+
# fallback for < 2.20 downgrade can be removed after we release 2.20
7980
if(VERSION_CONFIG
8081
MATCHES
81-
".*update_from_version[\t ]*=[\t ]*([0-9]+\\.[0-9]+\\.[0-9]+(-[a-z]+[0-9]*)?).*"
82+
".*downgrade_to_version[\t ]*=[\t ]*([0-9]+\\.[0-9]+\\.[0-9]+(-[a-z]+[0-9]*)?).*"
8283
)
8384
set(UPDATE_FROM_VERSION ${CMAKE_MATCH_1})
85+
set(DOWNGRADE_TO_VERSION ${CMAKE_MATCH_1})
86+
set(PREVIOUS_VERSION ${CMAKE_MATCH_1})
8487
endif()
8588

86-
if(VERSION_CONFIG
87-
MATCHES
88-
".*downgrade_to_version[\t ]*=[\t ]*([0-9]+\\.[0-9]+\\.[0-9]+(-[a-z]+[0-9]*)?).*"
89+
if(VERSION_CONFIG MATCHES
90+
".*previous_version[\t ]*=[\t ]*([0-9]+\\.[0-9]+\\.[0-9]+(-[a-z]+[0-9]*)?).*"
8991
)
90-
set(DOWNGRADE_TO_VERSION ${CMAKE_MATCH_1})
92+
set(PREVIOUS_VERSION ${CMAKE_MATCH_1})
9193
endif()
9294

9395
# a hack to avoid change of SQL extschema variable
@@ -119,7 +121,7 @@ endif()
119121

120122
message(
121123
STATUS
122-
"TimescaleDB version ${PROJECT_VERSION_MOD}. Can be updated from version ${UPDATE_FROM_VERSION}"
124+
"TimescaleDB version ${PROJECT_VERSION_MOD}. Can be updated from version ${PREVIOUS_VERSION}"
123125
)
124126
message(STATUS "Build type is ${CMAKE_BUILD_TYPE}")
125127

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ See more:
181181
182182
## Want TimescaleDB hosted and managed for you? Try Timescale Cloud
183183
184-
[Timescale Cloud](https://docs.timescale.com/getting-started/latest/) is the modern PostgreSQL data platform for all your applications. It enhances PostgreSQL to handle time series, events, real-time analytics, and vector search—all in a single database alongside transactional workloads. You get one system that handles live data ingestion, late and out-of-order updates, and low latency queries, with the performance, reliability, and scalability your app needs. Ideal for IoT, crypto, finance, SaaS, and a myriad other domains, Timescale Cloud allows you to build data-heavy, mission-critical apps while retaining the familiarity and reliability of PostgreSQL.
184+
[Timescale Cloud](https://docs.timescale.com/getting-started/latest/) is the modern PostgreSQL data platform for all your applications. It enhances PostgreSQL to handle time series, events, real-time analytics, and vector search—all in a single database alongside transactional workloads. You get one system that handles live data ingestion, late and out-of-order updates, and low latency queries, with the performance, reliability, and scalability your app needs. Ideal for IoT, crypto, finance, SaaS, and a myriad other domains, Timescale Cloud allows you to build data-heavy, mission-critical apps while retaining the familiarity and reliability of PostgreSQL. See [our whitepaper](https://docs.timescale.com/about/latest/whitepaper/) for a deep dive into Timescale's architecture and how it meets the needs of even the most demanding applications.
185185

186186
A Timescale Cloud service is a single optimized 100% PostgreSQL database instance that you use as is, or extend with capabilities specific to your business needs. The available capabilities are:
187187

scripts/changelog/generate.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ get_version_config_var() {
1818
}
1919

2020
RELEASE_NEXT=$(get_version_config_var '^version')
21-
RELEASE_PREVIOUS=$(get_version_config_var '^update_from_version')
21+
RELEASE_PREVIOUS=$(get_version_config_var '^previous_version')
2222

2323
echo "Building CHANGELOG"
2424
{

scripts/test_downgrade.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fi
1616
BUILD_DIR="build_update_pg${PG_MAJOR_VERSION}"
1717

1818
CURRENT_VERSION=$(grep '^version ' version.config | awk '{ print $3 }')
19-
PREV_VERSION=$(grep '^downgrade_to_version ' version.config | awk '{ print $3 }')
19+
PREV_VERSION=$(grep '^previous_version ' version.config | awk '{ print $3 }')
2020

2121
if [ ! -d "${BUILD_DIR}" ]; then
2222
echo "Initializing build directory"

scripts/test_update_from_version.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
set -e
1010
set -u
1111

12-
FROM_VERSION=${FROM_VERSION:-$(grep '^downgrade_to_version ' version.config | awk '{ print $3 }')}
12+
FROM_VERSION=${FROM_VERSION:-$(grep '^previous_version ' version.config | awk '{ print $3 }')}
1313
TO_VERSION=${TO_VERSION:-$(grep '^version ' version.config | awk '{ print $3 }')}
1414

1515
TEST_REPAIR=${TEST_REPAIR:-false}

scripts/test_updates.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ VERSIONS=""
1818
FAILED_VERSIONS=""
1919

2020
ALL_VERSIONS=$(git tag --sort=taggerdate | grep -P '^[2]\.[0-9]+\.[0-9]+$')
21-
MAX_VERSION=$(grep '^downgrade_to_version ' version.config | awk '{ print $3 }')
21+
MAX_VERSION=$(grep '^previous_version ' version.config | awk '{ print $3 }')
2222

2323
# major version is always 2 atm
2424
max_minor_version=$(echo "${MAX_VERSION}" | awk -F. '{print $2}')

sql/CMakeLists.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ else()
105105
SOURCE_VERSION
106106
${PROJECT_VERSION_MOD}
107107
TARGET_VERSION
108-
${DOWNGRADE_TO_VERSION}
108+
${PREVIOUS_VERSION}
109109
INPUT_DIRECTORY
110110
${CMAKE_CURRENT_SOURCE_DIR}/updates
111111
FILES
@@ -235,12 +235,12 @@ set(MOD_FILE_REGEX
235235

236236
# We'd like to process the updates in reverse (descending) order
237237
if(EXISTS
238-
"${CMAKE_CURRENT_SOURCE_DIR}/updates/${UPDATE_FROM_VERSION}--${PROJECT_VERSION_MOD}.sql"
238+
"${CMAKE_CURRENT_SOURCE_DIR}/updates/${PREVIOUS_VERSION}--${PROJECT_VERSION_MOD}.sql"
239239
)
240240
set(MOD_FILES_LIST ${MOD_FILES_VERSIONED})
241241
else()
242242
set(MOD_FILES_LIST
243-
"${MOD_FILES_VERSIONED};updates/${UPDATE_FROM_VERSION}--${PROJECT_VERSION_MOD}.sql"
243+
"${MOD_FILES_VERSIONED};updates/${PREVIOUS_VERSION}--${PROJECT_VERSION_MOD}.sql"
244244
)
245245
endif()
246246

@@ -259,7 +259,7 @@ set(CURR_MOD_FILES "${LASTEST_MOD_VERSIONED}")
259259
foreach(transition_mod_file ${MOD_FILES_LIST})
260260

261261
if(NOT (${transition_mod_file} MATCHES ${MOD_FILE_REGEX}))
262-
message(FATAL_ERROR "Cannot parse update file name ${mod_file}")
262+
message(FATAL_ERROR "Cannot parse update file name ${transition_mod_file}")
263263
endif()
264264

265265
set(START_VERSION ${CMAKE_MATCH_1})

sql/policy_api.sql

+2-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ CREATE OR REPLACE FUNCTION @[email protected]_continuous_aggregate_policy(
9090
timezone TEXT = NULL,
9191
include_tiered_data BOOL = NULL,
9292
buckets_per_batch INTEGER = NULL,
93-
max_batches_per_execution INTEGER = NULL
93+
max_batches_per_execution INTEGER = NULL,
94+
refresh_newest_first BOOL = NULL
9495
)
9596
RETURNS INTEGER
9697
AS '@MODULE_PATHNAME@', 'ts_policy_refresh_cagg_add'

sql/updates/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ not to any other preceeding versions.
8282

8383
The source and target versions are found in be found in the file
8484
`version.config` file in the root of the source tree, where `version`
85-
is the source version and `downgrade_to_version` is the target
85+
is the source version and `previous_version` is the target
8686
version. Note that we have a separate field for the downgrade.
8787

8888
A downgrade file consists of:
@@ -122,7 +122,7 @@ script to the immediately preceeding version.
122122
### When releasing a new version
123123

124124
When releasing a new version, please rename the file `reverse-dev.sql`
125-
to `<version>--<downgrade_to_version>.sql` and add that name to
125+
to `<version>--<previous_version>.sql` and add that name to
126126
`REV_FILES` variable in the `sql/CMakeLists.txt`. This will allow
127127
generation of downgrade scripts for any version in that list, but it
128128
is currently not added.

sql/updates/latest-dev.sql

+33-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,36 @@
1-
21
DROP FUNCTION IF EXISTS _timescaledb_internal.create_chunk_table;
32
DROP FUNCTION IF EXISTS _timescaledb_functions.create_chunk_table;
43

4+
-- New option `refresh_newest_first` for incremental cagg refresh policy
5+
DROP FUNCTION @[email protected]_continuous_aggregate_policy(
6+
continuous_aggregate REGCLASS,
7+
start_offset "any",
8+
end_offset "any",
9+
schedule_interval INTERVAL,
10+
if_not_exists BOOL,
11+
initial_start TIMESTAMPTZ,
12+
timezone TEXT,
13+
include_tiered_data BOOL,
14+
buckets_per_batch INTEGER,
15+
max_batches_per_execution INTEGER
16+
);
17+
18+
CREATE FUNCTION @[email protected]_continuous_aggregate_policy(
19+
continuous_aggregate REGCLASS,
20+
start_offset "any",
21+
end_offset "any",
22+
schedule_interval INTERVAL,
23+
if_not_exists BOOL = false,
24+
initial_start TIMESTAMPTZ = NULL,
25+
timezone TEXT = NULL,
26+
include_tiered_data BOOL = NULL,
27+
buckets_per_batch INTEGER = NULL,
28+
max_batches_per_execution INTEGER = NULL,
29+
refresh_newest_first BOOL = NULL
30+
)
31+
RETURNS INTEGER
32+
AS '@MODULE_PATHNAME@', 'ts_update_placeholder'
33+
LANGUAGE C VOLATILE;
34+
35+
UPDATE _timescaledb_catalog.hypertable SET chunk_sizing_func_schema = '_timescaledb_functions' WHERE chunk_sizing_func_schema = '_timescaledb_internal' AND chunk_sizing_func_name = 'calculate_chunk_interval';
36+

0 commit comments

Comments
 (0)