Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
e059e02e
Commit
e059e02e
authored
Mar 01, 2015
by
Alvaro Herrera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix intermittent failure in event_trigger test
As evidenced by measles in buildfarm. Pointed out by Tom.
parent
e524cbdc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
4 deletions
+21
-4
src/test/regress/expected/event_trigger.out
src/test/regress/expected/event_trigger.out
+11
-3
src/test/regress/sql/event_trigger.sql
src/test/regress/sql/event_trigger.sql
+10
-1
No files found.
src/test/regress/expected/event_trigger.out
View file @
e059e02e
...
@@ -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;
...
...
src/test/regress/sql/event_trigger.sql
View file @
e059e02e
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment