Commit e059e02e authored by Alvaro Herrera's avatar Alvaro Herrera

Fix intermittent failure in event_trigger test

As evidenced by measles in buildfarm.  Pointed out by Tom.
parent e524cbdc
...@@ -370,13 +370,21 @@ alter table rewriteme ...@@ -370,13 +370,21 @@ alter table rewriteme
NOTICE: Table 'rewriteme' is being rewritten (reason = 6) NOTICE: Table 'rewriteme' is being rewritten (reason = 6)
-- shouldn't trigger a table_rewrite event -- shouldn't trigger a table_rewrite event
alter table rewriteme alter column foo type numeric(12,4); alter table rewriteme alter column foo type numeric(12,4);
-- typed tables are rewritten when their type changes -- typed tables are rewritten when their type changes. Don't emit table
-- name, because firing order is not stable.
CREATE OR REPLACE FUNCTION test_evtrig_no_rewrite() RETURNS event_trigger
LANGUAGE plpgsql AS $$
BEGIN
RAISE NOTICE 'Table is being rewritten (reason = %)',
pg_event_trigger_table_rewrite_reason();
END;
$$;
create type rewritetype as (a int); create type rewritetype as (a int);
create table rewritemetoo1 of rewritetype; create table rewritemetoo1 of rewritetype;
create table rewritemetoo2 of rewritetype; create table rewritemetoo2 of rewritetype;
alter type rewritetype alter attribute a type text cascade; alter type rewritetype alter attribute a type text cascade;
NOTICE: Table 'rewritemetoo1' is being rewritten (reason = 4) NOTICE: Table is being rewritten (reason = 4)
NOTICE: Table 'rewritemetoo2' is being rewritten (reason = 4) NOTICE: Table is being rewritten (reason = 4)
-- but this doesn't work -- but this doesn't work
create table rewritemetoo3 (a rewritetype); create table rewritemetoo3 (a rewritetype);
alter type rewritetype alter attribute a type varchar cascade; alter type rewritetype alter attribute a type varchar cascade;
......
...@@ -276,7 +276,16 @@ alter table rewriteme ...@@ -276,7 +276,16 @@ alter table rewriteme
-- shouldn't trigger a table_rewrite event -- shouldn't trigger a table_rewrite event
alter table rewriteme alter column foo type numeric(12,4); alter table rewriteme alter column foo type numeric(12,4);
-- typed tables are rewritten when their type changes -- typed tables are rewritten when their type changes. Don't emit table
-- name, because firing order is not stable.
CREATE OR REPLACE FUNCTION test_evtrig_no_rewrite() RETURNS event_trigger
LANGUAGE plpgsql AS $$
BEGIN
RAISE NOTICE 'Table is being rewritten (reason = %)',
pg_event_trigger_table_rewrite_reason();
END;
$$;
create type rewritetype as (a int); create type rewritetype as (a int);
create table rewritemetoo1 of rewritetype; create table rewritemetoo1 of rewritetype;
create table rewritemetoo2 of rewritetype; create table rewritemetoo2 of rewritetype;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment