You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PostgreSQL version (output of postgres --version): PostgreSQL 13.3
TimescaleDB version (output of \dx in psql): 2.3.1
Installation method: Timescale Cloud (AWS)
Describe the bug
after defining a continuous aggregation materialized view it is no more possible to insert a row in a compressed chunk of the source hypertable
To Reproduce
-- Create table
CREATE TABLE ee_mis_hh_2gbug
(
UNIVERSAL_TIME INT NOT NULL,
POD TEXT NOT NULL,
DT_MISURA DATE NOT NULL,
ORA_96 INT,
Q_EA_RFO DOUBLE PRECISION,
Q_ER_RFO DOUBLE PRECISION,
TMS_RFO DATE,
Q_EA_PDO_EV DOUBLE PRECISION,
Q_ER_PDO_EV DOUBLE PRECISION,
TMS_PDO_EV DATE,
Q_EA_PDO_NE DOUBLE PRECISION,
Q_ER_PDO_NE DOUBLE PRECISION,
TMS_PDO_NE DATE,
FLG_PDO_NE TEXT,
Q_EA_SOS DOUBLE PRECISION,
Q_ER_SOS DOUBLE PRECISION,
TMS_SOS DATE,
Q_F_BP DOUBLE PRECISION,
TMS_F_BP DATE,
ID_MISURA_M2G TEXT,
TMS_CREATED TIMESTAMP WITHOUT TIME ZONE,
USR_CREATED TEXT,
FLG_F_BP TEXT,
TMS_UPDATED TIMESTAMP WITHOUT TIME ZONE
);
-- Create hypertable
SELECT create_hypertable('ee_mis_hh_2gbug', 'dt_misura', chunk_time_interval => INTERVAL '1 day');
-- Insert sample data
INSERT INTO ee_mis_hh_2gbug (universal_time,pod,dt_misura,ora_96,q_ea_rfo,q_er_rfo,tms_rfo,q_ea_pdo_ev,q_er_pdo_ev,tms_pdo_ev,q_ea_pdo_ne,q_er_pdo_ne,tms_pdo_ne,flg_pdo_ne,q_ea_sos,q_er_sos,tms_sos,q_f_bp,tms_f_bp,id_misura_m2g,tms_created,usr_created,flg_f_bp,tms_updated) VALUES
(1507743900,'OT00XO12345678','2019-10-11',75,NULL,NULL,NULL,0.325,0.0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.322,NULL,'0000000000000000000127815598',NULL,'testbug','LT',NULL);
-- Create Continous aggregation
CREATE MATERIALIZED VIEW mv_ee_mis_hh_2gbug
WITH (timescaledb.continuous) AS
SELECT universal_time AS universal_time,
dt_misura AS dt_misura,
ora_96 AS ora_96,
time_bucket(INTERVAL '1 day', dt_misura) AS bucket,
SUM (COALESCE (m.q_ea_rfo,
m.q_ea_pdo_ev,
m.q_ea_sos,
m.q_ea_pdo_ne,
m.q_f_bp)) AS q_bc,
SUM (COALESCE (m.q_ea_rfo,
m.q_ea_pdo_ev,
m.q_ea_sos,
m.q_ea_pdo_ne)) AS q_meter,
SUM (m.q_ea_pdo_ne) AS q_stima,
SUM (m.q_f_bp) AS q_f_bp,
COUNT (COALESCE (m.q_ea_rfo,
m.q_ea_pdo_ev,
m.q_ea_sos,
m.q_ea_pdo_ne,
m.q_f_bp)) AS n_bc,
COUNT (COALESCE (m.q_ea_rfo,
m.q_ea_pdo_ev,
m.q_ea_sos,
m.q_ea_pdo_ne)) AS n_meter,
COUNT (m.q_ea_pdo_ne) AS n_stima,
COUNT (m.q_f_bp) AS n_f_bp
FROM ee_mis_hh_2gbug m
GROUP BY universal_time,
dt_misura,
ora_96,
bucket;
-- Create policy
SELECT add_continuous_aggregate_policy('mv_ee_mis_hh_2gbug',
start_offset => INTERVAL '1 month',
end_offset => INTERVAL '1 day',
schedule_interval => INTERVAL '1 hour');
-- Compress
ALTER TABLE ee_mis_hh_2gbug SET (
timescaledb.compress,
timescaledb.compress_segmentby = 'pod'
);
-- Compress Policy
SELECT add_compression_policy('ee_mis_hh_2gbug', INTERVAL '1 days');
-- Insert row into compressed chunk (ERROR)
insert into ee_mis_hh_2gbug
select
universal_time, pod || 'W', dt_misura, ora_96, q_ea_rfo, q_er_rfo, tms_rfo, q_ea_pdo_ev, q_er_pdo_ev, tms_pdo_ev, q_ea_pdo_ne, q_er_pdo_ne, tms_pdo_ne, flg_pdo_ne, q_ea_sos, q_er_sos, tms_sos, q_f_bp, tms_f_bp, id_misura_m2g, tms_created, usr_created, flg_f_bp, tms_updated from ee_mis_hh_2gbug where pod = 'OT00XO12345678';
Expected behavior
a row should be inserted and the continuous aggregation materialized view should be updated
Actual behavior
the error "after insert row trigger on compressed chunk not supported" is thrown
Screenshots
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered:
After row triggers do not work when we insert into a compressed chunk.
This causes a problem for caggs as invalidations are not recorded.
Explicitly call the function to record invalidations when we
insert into a compressed chunk (if the hypertable has caggs
defined on it)
Fixestimescale#3410.
gayyappan
added a commit
to gayyappan/timescaledb
that referenced
this issue
Oct 21, 2021
After row triggers do not work when we insert into a compressed chunk.
This causes a problem for caggs as invalidations are not recorded.
Explicitly call the function to record invalidations when we
insert into a compressed chunk (if the hypertable has caggs
defined on it)
Fixestimescale#3410.
After row triggers do not work when we insert into a compressed chunk.
This causes a problem for caggs as invalidations are not recorded.
Explicitly call the function to record invalidations when we
insert into a compressed chunk (if the hypertable has caggs
defined on it)
Fixes#3410.
Relevant system information:
postgres --version
): PostgreSQL 13.3\dx
inpsql
): 2.3.1Describe the bug
after defining a continuous aggregation materialized view it is no more possible to insert a row in a compressed chunk of the source hypertable
To Reproduce
Expected behavior
a row should be inserted and the continuous aggregation materialized view should be updated
Actual behavior
the error "after insert row trigger on compressed chunk not supported" is thrown
Screenshots
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: