@@ -168,51 +168,55 @@ SELECT
168168 NULL ::text AS orderby,
169169 NULL ::jsonb AS index;
170170
171- CREATE OR REPLACE VIEW timescaledb_information .stat_chunk_activity AS
172- SELECT
173- NULL ::regclass AS chunk,
174- NULL ::regclass AS compressed_chunk,
175- NULL ::integer AS chunk_id,
176- NULL ::integer AS hypertable_id,
177- NULL ::name AS hypertable,
178- NULL ::bigint AS compressed_batch_count,
179- NULL ::bigint AS compressed_block_count,
180- NULL ::bigint AS compressed_batch_rows_min,
181- NULL ::bigint AS compressed_batch_rows_max,
182- NULL ::bigint AS compressed_batch_rows_avg,
183- NULL ::double precision AS compressed_batch_rows_stddev,
184- NULL ::bigint AS compressed_batch_bytes_min,
185- NULL ::bigint AS compressed_batch_bytes_max,
186- NULL ::bigint AS compressed_batch_bytes_avg,
187- NULL ::double precision AS compressed_batch_bytes_stddev,
188- NULL ::bigint AS compressed_block_bytes_min,
189- NULL ::bigint AS compressed_block_bytes_max,
190- NULL ::bigint AS compressed_block_bytes_avg,
191- NULL ::double precision AS compressed_block_bytes_stddev,
192- NULL ::bigint AS total_batches_deleted,
193- NULL ::bigint AS total_batches_decompressed,
194- NULL ::bigint AS total_tuples_decompressed,
195- NULL ::bigint AS total_batches_scanned,
196- NULL ::bigint AS total_batches_checked_by_bloom,
197- NULL ::bigint AS total_batches_pruned_by_bloom,
198- NULL ::bigint AS total_batches_without_bloom,
199- NULL ::bigint AS total_batches_bloom_false_positives,
200- NULL ::bigint AS total_batches_filtered_compressed,
201- NULL ::bigint AS total_batches_filtered_decompressed,
202- NULL ::bigint AS last_op_batches_deleted,
203- NULL ::bigint AS last_op_batches_decompressed,
204- NULL ::bigint AS last_op_tuples_decompressed,
205- NULL ::bigint AS last_op_batches_scanned,
206- NULL ::bigint AS last_op_batches_checked_by_bloom,
207- NULL ::bigint AS last_op_batches_pruned_by_bloom,
208- NULL ::bigint AS last_op_batches_without_bloom,
209- NULL ::bigint AS last_op_batches_bloom_false_positives,
210- NULL ::bigint AS last_op_batches_filtered_compressed,
211- NULL ::bigint AS last_op_batches_filtered_decompressed,
212- NULL ::bigint AS n_selects,
213- NULL ::bigint AS n_inserts,
214- NULL ::bigint AS n_updates,
215- NULL ::bigint AS n_deletes,
216- NULL ::timestamptz AS first_update,
217- NULL ::timestamptz AS last_update;
218-
171+ DO $$
172+ BEGIN
173+ IF EXISTS (SELECT FROM pg_class WHERE relname = ' stat_chunk_activity' AND relkind = ' v' ) THEN
174+ CREATE OR REPLACE VIEW timescaledb_information .stat_chunk_activity AS
175+ SELECT
176+ NULL ::regclass AS chunk,
177+ NULL ::regclass AS compressed_chunk,
178+ NULL ::integer AS chunk_id,
179+ NULL ::integer AS hypertable_id,
180+ NULL ::name AS hypertable,
181+ NULL ::bigint AS compressed_batch_count,
182+ NULL ::bigint AS compressed_block_count,
183+ NULL ::bigint AS compressed_batch_rows_min,
184+ NULL ::bigint AS compressed_batch_rows_max,
185+ NULL ::bigint AS compressed_batch_rows_avg,
186+ NULL ::double precision AS compressed_batch_rows_stddev,
187+ NULL ::bigint AS compressed_batch_bytes_min,
188+ NULL ::bigint AS compressed_batch_bytes_max,
189+ NULL ::bigint AS compressed_batch_bytes_avg,
190+ NULL ::double precision AS compressed_batch_bytes_stddev,
191+ NULL ::bigint AS compressed_block_bytes_min,
192+ NULL ::bigint AS compressed_block_bytes_max,
193+ NULL ::bigint AS compressed_block_bytes_avg,
194+ NULL ::double precision AS compressed_block_bytes_stddev,
195+ NULL ::bigint AS total_batches_deleted,
196+ NULL ::bigint AS total_batches_decompressed,
197+ NULL ::bigint AS total_tuples_decompressed,
198+ NULL ::bigint AS total_batches_scanned,
199+ NULL ::bigint AS total_batches_checked_by_bloom,
200+ NULL ::bigint AS total_batches_pruned_by_bloom,
201+ NULL ::bigint AS total_batches_without_bloom,
202+ NULL ::bigint AS total_batches_bloom_false_positives,
203+ NULL ::bigint AS total_batches_filtered_compressed,
204+ NULL ::bigint AS total_batches_filtered_decompressed,
205+ NULL ::bigint AS last_op_batches_deleted,
206+ NULL ::bigint AS last_op_batches_decompressed,
207+ NULL ::bigint AS last_op_tuples_decompressed,
208+ NULL ::bigint AS last_op_batches_scanned,
209+ NULL ::bigint AS last_op_batches_checked_by_bloom,
210+ NULL ::bigint AS last_op_batches_pruned_by_bloom,
211+ NULL ::bigint AS last_op_batches_without_bloom,
212+ NULL ::bigint AS last_op_batches_bloom_false_positives,
213+ NULL ::bigint AS last_op_batches_filtered_compressed,
214+ NULL ::bigint AS last_op_batches_filtered_decompressed,
215+ NULL ::bigint AS n_selects,
216+ NULL ::bigint AS n_inserts,
217+ NULL ::bigint AS n_updates,
218+ NULL ::bigint AS n_deletes,
219+ NULL ::timestamptz AS first_update,
220+ NULL ::timestamptz AS last_update;
221+ END IF;
222+ END $$;
0 commit comments