diff --git a/tests/integration/test_postgresql_replica_database_engine_2/test.py b/tests/integration/test_postgresql_replica_database_engine_2/test.py index 3f2ec74180b..1d84ce0e3e9 100644 --- a/tests/integration/test_postgresql_replica_database_engine_2/test.py +++ b/tests/integration/test_postgresql_replica_database_engine_2/test.py @@ -719,6 +719,36 @@ def test_too_many_parts(started_cluster): pg_manager2.drop_materialized_db() +def test_toast(started_cluster): + table = "test_toast" + pg_manager.execute( + f"CREATE TABLE {table} (id integer PRIMARY KEY, txt text, other text)" + ) + pg_manager.create_materialized_db( + ip=started_cluster.postgres_ip, + port=started_cluster.postgres_port, + settings=[ + f"materialized_postgresql_tables_list = '{table}'", + "materialized_postgresql_backoff_min_ms = 100", + "materialized_postgresql_backoff_max_ms = 100", + ], + ) + + pg_manager.execute( + f"""\ +INSERT INTO {table} (id, txt)\ +VALUES (1, (SELECT array_to_string(ARRAY(SELECT chr((100 + round(random() * 25)) :: integer) FROM generate_series(1,30000) as t(i)), ''))) + """ + ) + + check_tables_are_synchronized( + instance, + table, + postgres_database=pg_manager.get_default_database(), + order_by="id", + ) + + if __name__ == "__main__": cluster.start() input("Cluster created, press any key to destroy...")