Skip to content

Commit 4c3740c

Browse files
svenklemmphilkra
andcommitted
Show deprecation warning when using hypercore access method
The hypercore access method is being deprecated and will be removed in a future release. This patch adds a warning when enabling the access method. Co-authored-by: Philip Krauss <[email protected]> Signed-off-by: Sven Klemm <[email protected]>
1 parent a0af9b0 commit 4c3740c

File tree

8 files changed

+18
-0
lines changed

8 files changed

+18
-0
lines changed

.unreleased/pr_8196

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Implements: #8196 Show deprecation warning for TAM

src/process_utility.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4136,6 +4136,9 @@ process_set_access_method(AlterTableCmd *cmd, ProcessUtilityArgs *args)
41364136
DEFELEM_UNSPEC,
41374137
-1);
41384138

4139+
elog(WARNING,
4140+
"the hypercore access method is marked as deprecated with the 2.21.0 release and will "
4141+
"be fully removed in the 2.22.0 release.");
41394142
AlterTableCmd *cmd = makeNode(AlterTableCmd);
41404143
cmd->type = T_AlterTableCmd;
41414144
cmd->subtype = AT_SetRelOptions;

tsl/test/expected/hypercore.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,7 @@ from generate_series('2022-06-01'::timestamptz, '2022-06-10'::timestamptz, '1h')
811811
alter table crossmodule_test
812812
set access method hypercore,
813813
set (timescaledb.compress_orderby = 'time');
814+
WARNING: the hypercore access method is marked as deprecated with the 2.21.0 release and will be fully removed in the 2.22.0 release.
814815
\c :TEST_DBNAME :ROLE_SUPERUSER
815816
select count(*) from crossmodule_test;
816817
count

tsl/test/expected/hypercore_copy.out

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ NOTICE: adding not-null constraint to column "created_at"
195195
(1 row)
196196

197197
alter table copy_test1 set access method hypercore;
198+
WARNING: the hypercore access method is marked as deprecated with the 2.21.0 release and will be fully removed in the 2.22.0 release.
198199
WARNING: there was some uncertainty picking the default segment by for the hypertable: You do not have any indexes on columns that can be used for segment_by and thus we are not using segment_by for converting to columnstore. Please make sure you are not missing any indexes
199200
NOTICE: default segment by for hypertable "copy_test1" is set to ""
200201
NOTICE: default order by for hypertable "copy_test1" is set to "created_at DESC"
@@ -252,6 +253,7 @@ select * from amrels where relparent = 'test1'::regclass;
252253
(1 row)
253254

254255
alter table test1 set access method hypercore;
256+
WARNING: the hypercore access method is marked as deprecated with the 2.21.0 release and will be fully removed in the 2.22.0 release.
255257
copy test1 from stdin delimiter ',';
256258
select count(*) from test1;
257259
count

tsl/test/expected/hypercore_create.out

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ select create_hypertable('test2', 'created_at');
135135
alter table test2
136136
set access method hypercore,
137137
set (compress_segmentby = 'location_id');
138+
WARNING: the hypercore access method is marked as deprecated with the 2.21.0 release and will be fully removed in the 2.22.0 release.
138139
WARNING: there was some uncertainty picking the default segment by for the hypertable: Please make sure device_id is not a unique column and appropriate for a segment by
139140
NOTICE: default segment by for hypertable "test2" is set to "device_id"
140141
NOTICE: default order by for hypertable "test2" is set to "created_at DESC"
@@ -143,16 +144,19 @@ ERROR: unrecognized parameter "compress_segmentby"
143144
alter table test2
144145
set access method hypercore,
145146
set (timescaledb.compress_segmentby = 'location_id');
147+
WARNING: the hypercore access method is marked as deprecated with the 2.21.0 release and will be fully removed in the 2.22.0 release.
146148
NOTICE: default order by for hypertable "test2" is set to "created_at DESC, device_id"
147149
-- Test altering hypertable to hypercore again. It should be allowed
148150
-- and be a no-op.
149151
alter table test2 set access method hypercore;
152+
WARNING: the hypercore access method is marked as deprecated with the 2.21.0 release and will be fully removed in the 2.22.0 release.
150153
\set ON_ERROR_STOP 0
151154
-- This shows an error but the error is weird, we should probably get
152155
-- a better one.
153156
alter table test2
154157
set access method hypercore,
155158
set (compress_segmentby = 'location_id');
159+
WARNING: the hypercore access method is marked as deprecated with the 2.21.0 release and will be fully removed in the 2.22.0 release.
156160
ERROR: unrecognized parameter "compress_segmentby"
157161
\set ON_ERROR_STOP 1
158162
-- Create view for hypercore rels
@@ -336,6 +340,7 @@ select * from amrels where relparent='test3'::regclass;
336340

337341
-- Set hypercore on hypertable
338342
alter table test3 set access method hypercore;
343+
WARNING: the hypercore access method is marked as deprecated with the 2.21.0 release and will be fully removed in the 2.22.0 release.
339344
-- Create a third chunk
340345
insert into test3 values ('2022-10-01', 1, 1.0);
341346
-- The third chunk should be a hypercore chunk
@@ -1122,6 +1127,7 @@ alter table conditions set (
11221127
-- Set hypercore access method on the hypertable
11231128
-------------------------------------------------------------------------------
11241129
alter table conditions set access method hypercore;
1130+
WARNING: the hypercore access method is marked as deprecated with the 2.21.0 release and will be fully removed in the 2.22.0 release.
11251131
-----------------------
11261132
-- Create a new user
11271133
-----------------------

tsl/test/expected/hypercore_insert.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ insert into test2 select t, 'second'::text, 120, 1 from generate_series(11, 15)
330330
alter table test2
331331
set access method hypercore,
332332
set (timescaledb.compress_segmentby = '', timescaledb.compress_orderby = 'c, itime desc');
333+
WARNING: the hypercore access method is marked as deprecated with the 2.21.0 release and will be fully removed in the 2.22.0 release.
333334
select compress_chunk(show_chunks('test2'));
334335
compress_chunk
335336
-----------------------------------------

tsl/test/expected/hypercore_trigger.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ select format('%I.%I', chunk_schema, chunk_name)::regclass as chunk2
114114
-- Set the hypercore access method on the hypertable for transition
115115
-- tables to work properly.
116116
alter table :hypertable set access method hypercore;
117+
WARNING: the hypercore access method is marked as deprecated with the 2.21.0 release and will be fully removed in the 2.22.0 release.
117118
create table saved_rows (like :chunk1, new_row bool not null, kind text);
118119
create table count_stmt (inserts int, updates int, deletes int);
119120
create function save_row() returns trigger as $$

tsl/test/expected/hypercore_vacuum.out

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ alter table hystable set access method hypercore, set (
5151
timescaledb.compress_orderby = 'time',
5252
timescaledb.compress_segmentby = 'location'
5353
);
54+
WARNING: the hypercore access method is marked as deprecated with the 2.21.0 release and will be fully removed in the 2.22.0 release.
5455
select ch chunk, amname access_method
5556
from show_chunks('hystable') ch
5657
inner join pg_class cl on (cl.oid = ch)
@@ -391,6 +392,7 @@ NOTICE: adding not-null constraint to column "time"
391392
alter table hystable set access method hypercore, set (
392393
timescaledb.compress_orderby = 'time'
393394
);
395+
WARNING: the hypercore access method is marked as deprecated with the 2.21.0 release and will be fully removed in the 2.22.0 release.
394396
-- vacuum on empty table
395397
vacuum (index_cleanup on) hystable;
396398
insert into hystable select * from regtable;
@@ -443,6 +445,7 @@ alter table readings
443445
set access method hypercore,
444446
set (timescaledb.compress_orderby = 'time',
445447
timescaledb.compress_segmentby = 'device');
448+
WARNING: the hypercore access method is marked as deprecated with the 2.21.0 release and will be fully removed in the 2.22.0 release.
446449
-- Save frozenxid to test that it advances on hypertable root when
447450
-- root is using Hypercore TAM.
448451
select relfrozenxid as old_relfrozenxid

0 commit comments

Comments
 (0)