Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2c48b3d

Browse files
committed
here are the copy2.sql and copy2.out files for the new regression
testsBrent Verner
1 parenta90db34 commit2c48b3d

File tree

2 files changed

+101
-0
lines changed

2 files changed

+101
-0
lines changed

‎src/test/regress/expected/copy2.out

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
CREATE TABLE x (
2+
a serial,
3+
b int,
4+
c text not null default 'stuff',
5+
d text not null,
6+
e text
7+
);
8+
NOTICE: CREATE TABLE will create implicit sequence 'x_a_seq' for SERIAL column 'x.a'
9+
NOTICE: CREATE TABLE / UNIQUE will create implicit index 'x_a_key' for table 'x'
10+
CREATE FUNCTION fn_x_before () RETURNS OPAQUE AS '
11+
BEGIN
12+
NEW.e := ''before trigger fired''::text;
13+
return NEW;
14+
END;
15+
' language 'plpgsql';
16+
CREATE FUNCTION fn_x_after () RETURNS OPAQUE AS '
17+
BEGIN
18+
UPDATE x set e=''after trigger fired'' where c=''stuff'';
19+
return NULL;
20+
END;
21+
' language 'plpgsql';
22+
CREATE TRIGGER trg_x_after AFTER INSERT ON x
23+
FOR EACH ROW EXECUTE PROCEDURE fn_x_after();
24+
CREATE TRIGGER trg_x_before BEFORE INSERT ON x
25+
FOR EACH ROW EXECUTE PROCEDURE fn_x_before();
26+
COPY x (a,b,c,d,e) from stdin;
27+
COPY x (b,d) from stdin;
28+
COPY x (b,d) from stdin;
29+
COPY x (a,b,c,d,e) from stdin;
30+
COPY x TO stdout;
31+
10000213141before trigger fired
32+
10001223242before trigger fired
33+
10002233343before trigger fired
34+
10003243444before trigger fired
35+
10004253545before trigger fired
36+
10005263646before trigger fired
37+
11stufftest_1after trigger fired
38+
22stufftest_2after trigger fired
39+
33stufftest_3after trigger fired
40+
44stufftest_4after trigger fired
41+
55stufftest_5after trigger fired
42+
DROP TABLE x;
43+
DROP SEQUENCE x_a_seq;
44+
DROP FUNCTION fn_x_before();
45+
DROP FUNCTION fn_x_after();

‎src/test/regress/sql/copy2.sql

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
CREATETABLEx (
2+
aserial,
3+
bint,
4+
ctextnot null default'stuff',
5+
dtextnot null,
6+
etext
7+
);
8+
9+
CREATEFUNCTIONfn_x_before () RETURNS OPAQUEAS'
10+
BEGIN
11+
NEW.e :=''before trigger fired''::text;
12+
return NEW;
13+
END;
14+
' language'plpgsql';
15+
16+
CREATEFUNCTIONfn_x_after () RETURNS OPAQUEAS'
17+
BEGIN
18+
UPDATE x set e=''after trigger fired'' where c=''stuff'';
19+
return NULL;
20+
END;
21+
' language'plpgsql';
22+
23+
CREATETRIGGERtrg_x_after AFTER INSERTON x
24+
FOR EACH ROW EXECUTE PROCEDURE fn_x_after();
25+
26+
CREATETRIGGERtrg_x_before BEFORE INSERTON x
27+
FOR EACH ROW EXECUTE PROCEDURE fn_x_before();
28+
29+
COPY x (a,b,c,d,e)from stdin;
30+
1000021314151
31+
\.
32+
33+
COPY x (b,d)from stdin;
34+
1test_1
35+
\.
36+
37+
COPY x (b,d)from stdin;
38+
2test_2
39+
3test_3
40+
4test_4
41+
5test_5
42+
\.
43+
44+
COPY x (a,b,c,d,e)from stdin;
45+
1000122324252
46+
1000223334353
47+
1000324344454
48+
1000425354555
49+
1000526364656
50+
\.
51+
52+
COPY x TO stdout;
53+
DROPTABLE x;
54+
DROPSEQUENCE x_a_seq;
55+
DROPFUNCTION fn_x_before();
56+
DROPFUNCTION fn_x_after();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp