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
a19ea9c6
Commit
a19ea9c6
authored
May 16, 2017
by
Kevin Grittner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Add a test for transition table usage in FOR EACH ROW trigger."
This reverts commit
4a03f935
.
parent
4a03f935
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
53 deletions
+0
-53
src/test/regress/expected/sanity_check.out
src/test/regress/expected/sanity_check.out
+0
-1
src/test/regress/expected/triggers.out
src/test/regress/expected/triggers.out
+0
-27
src/test/regress/sql/triggers.sql
src/test/regress/sql/triggers.sql
+0
-25
No files found.
src/test/regress/expected/sanity_check.out
View file @
a19ea9c6
...
@@ -191,7 +191,6 @@ timestamp_tbl|f
...
@@ -191,7 +191,6 @@ timestamp_tbl|f
timestamptz_tbl|f
timestamptz_tbl|f
timetz_tbl|f
timetz_tbl|f
tinterval_tbl|f
tinterval_tbl|f
transition_table_for_rows|f
varchar_tbl|f
varchar_tbl|f
-- restore normal output mode
-- restore normal output mode
\a\t
\a\t
...
...
src/test/regress/expected/triggers.out
View file @
a19ea9c6
...
@@ -1893,30 +1893,3 @@ copy parted_stmt_trig1(a) from stdin;
...
@@ -1893,30 +1893,3 @@ copy parted_stmt_trig1(a) from stdin;
NOTICE: trigger on parted_stmt_trig1 BEFORE INSERT for ROW
NOTICE: trigger on parted_stmt_trig1 BEFORE INSERT for ROW
NOTICE: trigger on parted_stmt_trig1 AFTER INSERT for ROW
NOTICE: trigger on parted_stmt_trig1 AFTER INSERT for ROW
drop table parted_stmt_trig, parted2_stmt_trig;
drop table parted_stmt_trig, parted2_stmt_trig;
--
-- Verify that transition table in FOR EACH ROW trigge shows all rows affected
-- by the statement (through the end) for each row (from the beginning).
--
create table transition_table_for_rows (c int not null);
create function transition_table_for_rows_func()
returns trigger
language plpgsql
as $$
begin
raise notice '% / % = %',
new.c,
(select sum(c) from newtable),
(select new.c::float / sum(newtable.c) from newtable);
return null;
end;
$$;
create trigger transition_table_for_rows_trig
after insert or update on transition_table_for_rows
referencing new table as newtable
for each row
execute procedure transition_table_for_rows_func();
insert into transition_table_for_rows select generate_series(1,4);
NOTICE: 1 / 10 = 0.1
NOTICE: 2 / 10 = 0.2
NOTICE: 3 / 10 = 0.3
NOTICE: 4 / 10 = 0.4
src/test/regress/sql/triggers.sql
View file @
a19ea9c6
...
@@ -1360,28 +1360,3 @@ copy parted_stmt_trig1(a) from stdin;
...
@@ -1360,28 +1360,3 @@ copy parted_stmt_trig1(a) from stdin;
\
.
\
.
drop
table
parted_stmt_trig
,
parted2_stmt_trig
;
drop
table
parted_stmt_trig
,
parted2_stmt_trig
;
--
-- Verify that transition table in FOR EACH ROW trigger shows all rows
-- affected by the statement (through the end) for each row (from the
-- beginning).
--
create
table
transition_table_for_rows
(
c
int
not
null
);
create
function
transition_table_for_rows_func
()
returns
trigger
language
plpgsql
as
$$
begin
raise
notice
'% / % = %'
,
new
.
c
,
(
select
sum
(
c
)
from
newtable
),
(
select
new
.
c
::
float
/
sum
(
newtable
.
c
)
from
newtable
);
return
null
;
end
;
$$
;
create
trigger
transition_table_for_rows_trig
after
insert
or
update
on
transition_table_for_rows
referencing
new
table
as
newtable
for
each
row
execute
procedure
transition_table_for_rows_func
();
insert
into
transition_table_for_rows
select
generate_series
(
1
,
4
);
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