Skip to content

Commit 9de0dea

Browse files
committed
Use regclass for storing relation reference in chunk catalog table
The chunk catalog no longer stores the schema and table name; the chunk relation is referenced by relid instead.
1 parent 358b18b commit 9de0dea

196 files changed

Lines changed: 2498 additions & 2453 deletions

File tree

Some content is hidden

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

.unreleased/pr_10231

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Implements: #10231 Use regclass for storing relation reference in chunk table

scripts/dump_meta_data.sql

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ SELECT id, schema_name, table_name, associated_schema_name, associated_table_pre
4646
SELECT ch.id AS chunk_id, ci.indexrelid::regclass::text AS index_name, h.id AS hypertable_id
4747
FROM _timescaledb_catalog.hypertable h
4848
JOIN _timescaledb_catalog.chunk ch ON ch.hypertable_id = h.id
49-
JOIN pg_index ci ON ci.indrelid = format('%I.%I', ch.schema_name, ch.table_name)::regclass
49+
JOIN pg_index ci ON ci.indrelid = ch.relid
5050
ORDER BY h.id, ch.id, ci.indrelid::regclass::text;
5151

5252
\echo 'Size of hypertables'
@@ -59,8 +59,8 @@ SELECT hypertable,
5959
SELECT *, total_bytes-index_bytes-COALESCE(toast_bytes,0) AS table_bytes FROM (
6060
SELECT
6161
pgc.oid::regclass::text as hypertable,
62-
sum(pg_total_relation_size('"' || c.schema_name || '"."' || c.table_name || '"'))::bigint as total_bytes,
63-
sum(pg_indexes_size('"' || c.schema_name || '"."' || c.table_name || '"'))::bigint AS index_bytes,
62+
sum(pg_total_relation_size(c.relid))::bigint as total_bytes,
63+
sum(pg_indexes_size(c.relid))::bigint AS index_bytes,
6464
sum(pg_total_relation_size(reltoastrelid))::bigint AS toast_bytes
6565
FROM
6666
_timescaledb_catalog.hypertable h,
@@ -92,9 +92,9 @@ SELECT *,
9292
total_bytes-index_bytes-COALESCE(toast_bytes,0) AS table_bytes
9393
FROM (
9494
SELECT c.id as chunk_id,
95-
'"' || c.schema_name || '"."' || c.table_name || '"' as chunk_table,
96-
pg_total_relation_size('"' || c.schema_name || '"."' || c.table_name || '"') AS total_bytes,
97-
pg_indexes_size('"' || c.schema_name || '"."' || c.table_name || '"') AS index_bytes,
95+
c.relid::text as chunk_table,
96+
pg_total_relation_size(c.relid) AS total_bytes,
97+
pg_indexes_size(c.relid) AS index_bytes,
9898
pg_total_relation_size(reltoastrelid) AS toast_bytes,
9999
array_agg(d.column_name ORDER BY d.interval_length, d.column_name ASC) as partitioning_columns,
100100
array_agg(d.column_type ORDER BY d.interval_length, d.column_name ASC) as partitioning_column_types,

sql/chunk_constraint.sql

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,19 @@ $BODY$
1414
DECLARE
1515
chunk_row _timescaledb_catalog.chunk;
1616
hypertable_row _timescaledb_catalog.hypertable;
17+
chunk_schema NAME;
18+
chunk_table NAME;
1719
constraint_oid OID;
1820
constraint_type CHAR;
1921
def TEXT;
2022
indx_tablespace NAME;
2123
BEGIN
2224
SELECT * INTO STRICT chunk_row FROM _timescaledb_catalog.chunk c WHERE c.id = chunk_id;
2325
SELECT * INTO STRICT hypertable_row FROM _timescaledb_catalog.hypertable h WHERE h.id = chunk_row.hypertable_id;
26+
-- schema_name and table_name are derived from the chunk relation
27+
SELECT n.nspname, c.relname INTO STRICT chunk_schema, chunk_table
28+
FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
29+
WHERE c.oid = chunk_row.relid;
2430

2531
SELECT oid, contype INTO STRICT constraint_oid, constraint_type FROM pg_constraint
2632
WHERE conname = hypertable_constraint_name AND
@@ -50,13 +56,13 @@ BEGIN
5056
SET LOCAL search_path TO @extschema@, pg_temp;
5157
EXECUTE pg_catalog.format(
5258
$$ ALTER TABLE %I.%I ADD CONSTRAINT %I %s $$,
53-
chunk_row.schema_name, chunk_row.table_name, constraint_name, def
59+
chunk_schema, chunk_table, constraint_name, def
5460
);
5561

5662
IF indx_tablespace IS NOT NULL THEN
5763
EXECUTE pg_catalog.format(
5864
$$ ALTER INDEX %I.%I SET TABLESPACE %I $$,
59-
chunk_row.schema_name, constraint_name, indx_tablespace
65+
chunk_schema, constraint_name, indx_tablespace
6066
);
6167
END IF;
6268
END IF;

sql/maintenance_utils.sql

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,8 @@ BEGIN
128128
SELECT id FROM _timescaledb_catalog.chunk
129129
WHERE hypertable_id = _hypertable_id
130130
AND NOT EXISTS (
131-
SELECT FROM information_schema.tables
132-
WHERE tables.table_schema = chunk.schema_name
133-
AND tables.table_name = chunk.table_name
131+
SELECT FROM pg_catalog.pg_class
132+
WHERE pg_class.oid = chunk.relid
134133
)
135134
LOOP
136135
_removed := _removed + 1;
@@ -147,8 +146,7 @@ BEGIN
147146
OR compression_chunk_size.compressed_chunk_id = _chunk_id;
148147

149148
DELETE FROM _timescaledb_catalog.chunk
150-
WHERE chunk.id = _chunk_id
151-
OR chunk.compressed_chunk_id = _chunk_id;
149+
WHERE chunk.id = _chunk_id;
152150
END LOOP;
153151

154152
RETURN _removed;

sql/osm_api.sql

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,24 +74,26 @@ CREATE OR REPLACE FUNCTION _timescaledb_functions.get_chunk_info(IN chunk REGCLA
7474
SELECT
7575
ch.id AS chunk_id,
7676
ch.hypertable_id, ht.schema_name AS ht_schema_name, ht.table_name AS ht_table_name,
77-
ch.schema_name AS chunk_schema, ch.table_name AS chunk_name,
77+
ns.nspname AS chunk_schema, c.relname AS chunk_name,
7878
ch.osm_chunk AS is_osm_chunk,
7979
(ch.status & 4)::bool AS is_frozen
8080
FROM _timescaledb_catalog.chunk ch
81-
JOIN pg_class c ON c.oid=$1 AND ch.table_name=c.relname
82-
JOIN pg_namespace ns ON ns.oid = c.relnamespace AND ns.nspname = ch.schema_name
81+
JOIN pg_class c ON c.oid = ch.relid AND c.oid = $1
82+
JOIN pg_namespace ns ON ns.oid = c.relnamespace
8383
JOIN _timescaledb_catalog.hypertable ht ON ht.id=ch.hypertable_id;
8484
$$ LANGUAGE SQL STABLE SET search_path = pg_catalog, pg_temp;
8585

8686
CREATE OR REPLACE FUNCTION _timescaledb_functions.get_chunk_info_by_id(IN chunk_id INTEGER, OUT chunk_id INTEGER, OUT hypertable_id INTEGER, OUT ht_schema_name NAME, OUT ht_table_name NAME, OUT chunk_schema NAME, OUT chunk_name NAME, OUT is_osm_chunk BOOLEAN, OUT is_frozen BOOLEAN) AS $$
8787
SELECT
8888
ch.id AS chunk_id,
8989
ch.hypertable_id, ht.schema_name AS ht_schema_name, ht.table_name AS ht_table_name,
90-
ch.schema_name AS chunk_schema, ch.table_name AS chunk_name,
90+
ns.nspname AS chunk_schema, c.relname AS chunk_name,
9191
ch.osm_chunk AS is_osm_chunk,
9292
(ch.status & 4)::bool AS is_frozen
9393
FROM _timescaledb_catalog.chunk ch
9494
JOIN _timescaledb_catalog.hypertable ht ON ht.id=ch.hypertable_id
95+
JOIN pg_class c ON c.oid = ch.relid
96+
JOIN pg_namespace ns ON ns.oid = c.relnamespace
9597
WHERE ch.id = $1;
9698
$$ LANGUAGE SQL STABLE SET search_path = pg_catalog, pg_temp;
9799

@@ -100,8 +102,7 @@ AS $$
100102
SELECT range_start, range_end
101103
FROM _timescaledb_catalog.dimension_slice d
102104
JOIN _timescaledb_catalog.chunk ch ON ch.id = d.chunk_id
103-
JOIN pg_class c ON c.oid=$1 AND ch.table_name=c.relname
104-
JOIN pg_namespace ns ON ns.oid = c.relnamespace AND ns.nspname = ch.schema_name
105+
WHERE ch.relid = $1
105106
ORDER BY dimension_id LIMIT 1;
106107
$$ LANGUAGE SQL STABLE SET search_path = pg_catalog, pg_temp;
107108

sql/policy_internal.sql

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ BEGIN
5757
inactive_for := jsonb_object_field_text(config, 'inactive_for')::INTERVAL;
5858

5959
FOR chunk_rec IN
60-
SELECT ch.schema_name, ch.table_name
60+
SELECT ch.relid
6161
FROM _timescaledb_catalog.chunk ch
6262
WHERE ch.hypertable_id = htid
6363
AND NOT ch.osm_chunk
@@ -70,20 +70,19 @@ BEGIN
7070
-- so we don't keep recompacting chunks still receiving out-of-order data
7171
AND (inactive_for IS NULL OR NOT EXISTS (
7272
SELECT 1 FROM _timescaledb_functions.chunk_statistics(
73-
uncompressed_relid => format('%I.%I', ch.schema_name, ch.table_name)::regclass) s
73+
uncompressed_relid => ch.relid) s
7474
WHERE s.last_update >= now() - inactive_for))
7575
LOOP
7676
BEGIN
77-
PERFORM _timescaledb_functions.compact_chunk(
78-
format('%I.%I', chunk_rec.schema_name, chunk_rec.table_name)::regclass);
77+
PERFORM _timescaledb_functions.compact_chunk(chunk_rec.relid);
7978
numchunks := numchunks + 1;
8079
EXCEPTION WHEN OTHERS THEN
8180
GET STACKED DIAGNOSTICS
8281
_message = MESSAGE_TEXT,
8382
_detail = PG_EXCEPTION_DETAIL,
8483
_sqlstate = RETURNED_SQLSTATE;
85-
RAISE WARNING 'compaction policy failed to compact chunk "%.%"',
86-
chunk_rec.schema_name, chunk_rec.table_name
84+
RAISE WARNING 'compaction policy failed to compact chunk "%"',
85+
chunk_rec.relid
8786
USING DETAIL = format('Message: (%s), Detail: (%s).', _message, _detail),
8887
ERRCODE = _sqlstate;
8988
chunks_failure := chunks_failure + 1;
@@ -96,7 +95,7 @@ BEGIN
9695
-- search_path to caller, so we do SET LOCAL again after COMMIT
9796
SET LOCAL search_path TO pg_catalog, pg_temp;
9897
IF verbose_log THEN
99-
RAISE LOG 'job % completed compacting chunk %.%', job_id, chunk_rec.schema_name, chunk_rec.table_name;
98+
RAISE LOG 'job % completed compacting chunk %', job_id, chunk_rec.relid;
10099
END IF;
101100
-- max_chunks bounds the chunks processed per run, including ones that failed
102101
IF max_chunks > 0 AND processed >= max_chunks THEN
@@ -187,12 +186,12 @@ BEGIN
187186

188187
FOR chunk_rec IN
189188
SELECT
190-
show.oid, ch.schema_name, ch.table_name, ch.status
189+
show.oid, pgns.nspname AS schema_name, pgc.relname AS table_name, ch.status
191190
FROM
192191
@extschema@.show_chunks(htoid, older_than => lag, created_before => creation_lag) AS show(oid)
193192
INNER JOIN pg_class pgc ON pgc.oid = show.oid
194193
INNER JOIN pg_namespace pgns ON pgc.relnamespace = pgns.oid
195-
INNER JOIN _timescaledb_catalog.chunk ch ON ch.table_name = pgc.relname AND ch.schema_name = pgns.nspname AND ch.hypertable_id = htid
194+
INNER JOIN _timescaledb_catalog.chunk ch ON ch.relid = show.oid AND ch.hypertable_id = htid
196195
WHERE NOT ch.osm_chunk
197196
-- Checking for chunks which are not fully compressed and not frozen
198197
AND ch.status != status_fully_compressed
@@ -227,7 +226,7 @@ BEGIN
227226
FOR idx_rec IN
228227
SELECT idx.schemaname, idx.indexname
229228
FROM pg_indexes idx
230-
JOIN _timescaledb_catalog.chunk ch ON ch.schema_name = idx.schemaname AND ch.table_name = idx.tablename
229+
JOIN _timescaledb_catalog.chunk ch ON ch.relid = chunk_rec.oid
231230
WHERE idx.schemaname = chunk_rec.schema_name
232231
AND idx.tablename = chunk_rec.table_name
233232
AND ch.status = status_fully_compressed

sql/pre_install/tables.sql

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,14 @@ CREATE SEQUENCE _timescaledb_catalog.chunk_id_seq MINVALUE 1;
120120

121121
CREATE TABLE _timescaledb_catalog.chunk (
122122
id integer NOT NULL DEFAULT nextval('_timescaledb_catalog.chunk_id_seq'),
123+
relid regclass NOT NULL,
123124
hypertable_id int NOT NULL,
124-
schema_name name NOT NULL,
125-
table_name name NOT NULL,
126-
compressed_chunk_id integer ,
127125
status integer NOT NULL DEFAULT 0,
128126
osm_chunk boolean NOT NULL DEFAULT FALSE,
129127
creation_time timestamptz NOT NULL,
130128
-- table constraints
131129
CONSTRAINT chunk_pkey PRIMARY KEY (id),
132-
CONSTRAINT chunk_schema_name_table_name_key UNIQUE (schema_name, table_name),
130+
CONSTRAINT chunk_relid_key UNIQUE (relid),
133131
CONSTRAINT chunk_hypertable_id_fkey FOREIGN KEY (hypertable_id) REFERENCES _timescaledb_catalog.hypertable (id)
134132
) WITH (user_catalog_table = true);
135133
ALTER SEQUENCE _timescaledb_catalog.chunk_id_seq OWNED BY _timescaledb_catalog.chunk.id;

sql/size_utils.sql

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ SELECT
2222
h.table_name AS hypertable_name,
2323
h.id AS hypertable_id,
2424
c.id AS chunk_id,
25-
c.schema_name AS chunk_schema,
26-
c.table_name AS chunk_name,
25+
n.nspname AS chunk_schema,
26+
cl.relname AS chunk_name,
2727
COALESCE((relsize).total_size, 0) AS total_bytes,
2828
COALESCE((relsize).heap_size, 0) AS heap_bytes,
2929
COALESCE((relsize).index_size, 0) AS index_bytes,
@@ -35,9 +35,8 @@ SELECT
3535
FROM
3636
_timescaledb_catalog.hypertable h
3737
JOIN _timescaledb_catalog.chunk c ON h.id = c.hypertable_id
38-
JOIN pg_class cl ON cl.relname = c.table_name AND cl.relkind = 'r'
38+
JOIN pg_class cl ON cl.oid = c.relid AND cl.relkind = 'r'
3939
JOIN pg_namespace n ON n.oid = cl.relnamespace
40-
AND n.nspname = c.schema_name
4140
JOIN LATERAL _timescaledb_functions.relation_size(cl.oid) AS relsize ON TRUE
4241
LEFT JOIN _timescaledb_catalog.compression_settings cs ON cs.relid = cl.oid
4342
LEFT JOIN LATERAL _timescaledb_functions.relation_size(cs.compress_relid) AS relcompsize ON TRUE;
@@ -340,7 +339,7 @@ BEGIN
340339
-- for hypertables return the sum of the row counts of all chunks
341340
SELECT id FROM _timescaledb_catalog.hypertable INTO v_hypertable_id WHERE table_name = v_name AND schema_name = v_schema;
342341
IF FOUND THEN
343-
RETURN (SELECT coalesce(sum(_timescaledb_functions.get_approx_row_count(format('%I.%I',schema_name,table_name))),0)
342+
RETURN (SELECT coalesce(sum(_timescaledb_functions.get_approx_row_count(relid)),0)
344343
FROM _timescaledb_catalog.chunk
345344
WHERE hypertable_id = v_hypertable_id);
346345
END IF;
@@ -392,8 +391,8 @@ CREATE OR REPLACE VIEW _timescaledb_internal.compressed_chunk_stats AS
392391
SELECT
393392
srcht.schema_name AS hypertable_schema,
394393
srcht.table_name AS hypertable_name,
395-
srcch.schema_name AS chunk_schema,
396-
srcch.table_name AS chunk_name,
394+
n.nspname AS chunk_schema,
395+
cl.relname AS chunk_name,
397396
CASE WHEN srcch.status & 1 = 1 THEN
398397
'Compressed'::text
399398
ELSE
@@ -411,6 +410,8 @@ FROM
411410
_timescaledb_catalog.hypertable AS srcht
412411
JOIN _timescaledb_catalog.chunk AS srcch ON srcht.id = srcch.hypertable_id
413412
AND srcht.status & 4 = 4
413+
JOIN pg_class cl ON cl.oid = srcch.relid
414+
JOIN pg_namespace n ON n.oid = cl.relnamespace
414415
LEFT JOIN _timescaledb_catalog.compression_chunk_size map ON srcch.id = map.chunk_id;
415416

416417
GRANT SELECT ON _timescaledb_internal.compressed_chunk_stats TO PUBLIC;

sql/updates/latest-dev.sql

Lines changed: 73 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,82 @@ SET status = status | 4, -- set compression bit
6868
compression_state = 0
6969
WHERE compression_state = 1;
7070

71-
--
72-
-- END set compression status flag on hypertables
73-
--
74-
7571
ALTER TABLE _timescaledb_catalog.hypertable DROP CONSTRAINT hypertable_dim_compress_check;
7672
ALTER TABLE _timescaledb_catalog.hypertable ADD CONSTRAINT hypertable_num_dimensions_check CHECK (num_dimensions > 0);
7773
ALTER TABLE _timescaledb_catalog.hypertable DROP CONSTRAINT hypertable_compress_check;
7874

75+
--
76+
-- END set compression status flag on hypertables
77+
--
78+
7979
DROP FUNCTION IF EXISTS @extschema@.alter_job(job_id INTEGER, schedule_interval INTERVAL, max_runtime INTERVAL, max_retries INTEGER, retry_period INTERVAL, scheduled BOOL, config JSONB, next_start TIMESTAMPTZ, if_exists BOOL, check_config REGPROC, fixed_schedule BOOL, initial_start TIMESTAMPTZ, timezone TEXT, job_name TEXT);
8080

81+
--
82+
-- BEGIN add chunk.relid and drop chunk.compressed_chunk_id, schema_name, table_name
83+
--
84+
85+
CREATE TABLE _timescaledb_internal.tmp_chunk AS SELECT * FROM _timescaledb_catalog.chunk;
86+
CREATE TABLE _timescaledb_internal.tmp_chunk_seq_value AS SELECT last_value, is_called FROM _timescaledb_catalog.chunk_id_seq;
87+
88+
-- drop foreign keys referencing the chunk table
89+
ALTER TABLE _timescaledb_catalog.dimension_slice DROP CONSTRAINT dimension_slice_chunk_id_fkey;
90+
ALTER TABLE _timescaledb_catalog.chunk_column_stats DROP CONSTRAINT chunk_column_stats_chunk_id_fkey;
91+
ALTER TABLE _timescaledb_internal.bgw_policy_chunk_stats DROP CONSTRAINT bgw_policy_chunk_stats_chunk_id_fkey;
92+
ALTER TABLE _timescaledb_catalog.compression_chunk_size DROP CONSTRAINT compression_chunk_size_chunk_id_fkey;
93+
94+
-- drop dependent views, they are recreated later in the update
95+
DROP VIEW IF EXISTS _timescaledb_internal.hypertable_chunk_local_size;
96+
DROP VIEW IF EXISTS _timescaledb_internal.compressed_chunk_stats;
97+
98+
ALTER EXTENSION timescaledb DROP TABLE _timescaledb_catalog.chunk;
99+
ALTER EXTENSION timescaledb DROP SEQUENCE _timescaledb_catalog.chunk_id_seq;
100+
101+
DROP TABLE _timescaledb_catalog.chunk;
102+
103+
CREATE SEQUENCE _timescaledb_catalog.chunk_id_seq MINVALUE 1;
104+
105+
CREATE TABLE _timescaledb_catalog.chunk (
106+
id integer NOT NULL DEFAULT nextval('_timescaledb_catalog.chunk_id_seq'),
107+
relid regclass NOT NULL,
108+
hypertable_id int NOT NULL,
109+
status integer NOT NULL DEFAULT 0,
110+
osm_chunk boolean NOT NULL DEFAULT FALSE,
111+
creation_time timestamptz NOT NULL,
112+
CONSTRAINT chunk_pkey PRIMARY KEY (id),
113+
CONSTRAINT chunk_relid_key UNIQUE (relid)
114+
) WITH (user_catalog_table = true);
115+
116+
INSERT INTO _timescaledb_catalog.chunk
117+
(id, relid, hypertable_id, status, osm_chunk, creation_time)
118+
SELECT
119+
id, format('%I.%I', schema_name, table_name)::regclass, hypertable_id, status, osm_chunk, creation_time
120+
FROM _timescaledb_internal.tmp_chunk;
121+
122+
CREATE INDEX chunk_hypertable_id_idx ON _timescaledb_catalog.chunk (hypertable_id);
123+
CREATE INDEX chunk_osm_chunk_idx ON _timescaledb_catalog.chunk (osm_chunk, hypertable_id);
124+
CREATE INDEX chunk_hypertable_id_creation_time_idx ON _timescaledb_catalog.chunk (hypertable_id, creation_time);
125+
126+
ALTER SEQUENCE _timescaledb_catalog.chunk_id_seq OWNED BY _timescaledb_catalog.chunk.id;
127+
SELECT setval('_timescaledb_catalog.chunk_id_seq', last_value, is_called) FROM _timescaledb_internal.tmp_chunk_seq_value;
128+
129+
ALTER TABLE _timescaledb_catalog.chunk ADD CONSTRAINT chunk_hypertable_id_fkey FOREIGN KEY (hypertable_id) REFERENCES _timescaledb_catalog.hypertable (id);
130+
131+
SELECT pg_catalog.pg_extension_config_dump('_timescaledb_catalog.chunk', '');
132+
SELECT pg_catalog.pg_extension_config_dump('_timescaledb_catalog.chunk_id_seq', '');
133+
134+
-- restore foreign keys referencing the chunk table
135+
ALTER TABLE _timescaledb_catalog.dimension_slice ADD CONSTRAINT dimension_slice_chunk_id_fkey FOREIGN KEY (chunk_id) REFERENCES _timescaledb_catalog.chunk (id) ON DELETE CASCADE;
136+
ALTER TABLE _timescaledb_catalog.chunk_column_stats ADD CONSTRAINT chunk_column_stats_chunk_id_fkey FOREIGN KEY (chunk_id) REFERENCES _timescaledb_catalog.chunk (id);
137+
ALTER TABLE _timescaledb_internal.bgw_policy_chunk_stats ADD CONSTRAINT bgw_policy_chunk_stats_chunk_id_fkey FOREIGN KEY (chunk_id) REFERENCES _timescaledb_catalog.chunk (id) ON DELETE CASCADE;
138+
ALTER TABLE _timescaledb_catalog.compression_chunk_size ADD CONSTRAINT compression_chunk_size_chunk_id_fkey FOREIGN KEY (chunk_id) REFERENCES _timescaledb_catalog.chunk (id) ON DELETE CASCADE;
139+
140+
DROP TABLE _timescaledb_internal.tmp_chunk;
141+
DROP TABLE _timescaledb_internal.tmp_chunk_seq_value;
142+
143+
GRANT SELECT ON _timescaledb_catalog.chunk_id_seq TO PUBLIC;
144+
GRANT SELECT ON _timescaledb_catalog.chunk TO PUBLIC;
145+
146+
--
147+
-- END add chunk.relid
148+
--
149+

0 commit comments

Comments
 (0)