From 86dab91a9e8f6b4c2ccd2fa9f129422e208002ca Mon Sep 17 00:00:00 2001 From: Craig Ringer Date: Mon, 22 Jun 2015 12:08:10 +0800 Subject: [PATCH] Tests show that truncate triggers are created before bdr_group_create See #93 --- expected/preseed.out | 15 +++++++++++++++ sql/preseed.sql | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/expected/preseed.out b/expected/preseed.out index a681690815..45b26fc2b8 100644 --- a/expected/preseed.out +++ b/expected/preseed.out @@ -16,3 +16,18 @@ CREATE TABLE some_local_tbl(id serial primary key, key text unique not null, dat INSERT INTO some_local_tbl(key, data) VALUES('key1', 'data1'); INSERT INTO some_local_tbl(key, data) VALUES('key2', NULL); INSERT INTO some_local_tbl(key, data) VALUES('key3', 'data3'); +-- At this time we create the truncation trigger even though BDR +-- hasn't been activated yet. +\d+ some_local_tbl + Table "public.some_local_tbl" + Column | Type | Modifiers | Storage | Stats target | Description +--------+---------+-------------------------------------------------------------+----------+--------------+------------- + id | integer | not null default nextval('some_local_tbl_id_seq'::regclass) | plain | | + key | text | not null | extended | | + data | text | | extended | | +Indexes: + "some_local_tbl_pkey" PRIMARY KEY, btree (id) + "some_local_tbl_key_key" UNIQUE CONSTRAINT, btree (key) +Triggers: + truncate_trigger AFTER TRUNCATE ON some_local_tbl FOR EACH STATEMENT EXECUTE PROCEDURE bdr.queue_truncate() + diff --git a/sql/preseed.sql b/sql/preseed.sql index 75acafe9d5..22457dea86 100644 --- a/sql/preseed.sql +++ b/sql/preseed.sql @@ -19,3 +19,7 @@ CREATE TABLE some_local_tbl(id serial primary key, key text unique not null, dat INSERT INTO some_local_tbl(key, data) VALUES('key1', 'data1'); INSERT INTO some_local_tbl(key, data) VALUES('key2', NULL); INSERT INTO some_local_tbl(key, data) VALUES('key3', 'data3'); + +-- At this time we create the truncation trigger even though BDR +-- hasn't been activated yet. +\d+ some_local_tbl -- 2.39.5