mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-16 10:33:27 +08:00
Fix migration script
This commit is contained in:
parent
2c2aba8fad
commit
72b612cb7a
2574
sql/timescaledb--0.6.1--0.7.1.sql
Normal file
2574
sql/timescaledb--0.6.1--0.7.1.sql
Normal file
File diff suppressed because it is too large
Load Diff
@ -4,3 +4,22 @@ DROP FUNCTION _timescaledb_cache.invalidate_relcache(oid);
|
||||
|
||||
DROP FUNCTION drop_chunks(bigint,name,name,boolean);
|
||||
DROP FUNCTION drop_chunks(timestamptz,name,name,boolean);
|
||||
|
||||
WITH ind AS (
|
||||
SELECT chunk_con.chunk_id, pg_chunk_index_class.relname AS index_name
|
||||
FROM _timescaledb_catalog.chunk_constraint chunk_con
|
||||
INNER JOIN _timescaledb_catalog.chunk chunk ON (chunk_con.chunk_id = chunk.id)
|
||||
INNER JOIN _timescaledb_catalog.hypertable hypertable ON (chunk.hypertable_id = hypertable.id)
|
||||
INNER JOIN pg_constraint pg_chunk_con ON (
|
||||
pg_chunk_con.conrelid = format('%I.%I', chunk.schema_name, chunk.table_name)::regclass
|
||||
AND pg_chunk_con.conname = chunk_con.constraint_name
|
||||
AND pg_chunk_con.contype = 'f'
|
||||
)
|
||||
INNER JOIN pg_class pg_chunk_index_class ON (
|
||||
pg_chunk_con.conindid = pg_chunk_index_class.oid
|
||||
)
|
||||
)
|
||||
DELETE
|
||||
FROM _timescaledb_catalog.chunk_index ci
|
||||
USING ind
|
||||
WHERE ci.chunk_id = ind.chunk_id AND ci.index_name = ind.index_name;
|
||||
|
Loading…
x
Reference in New Issue
Block a user