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

Commit28d90a5

Browse files
committed
move plpgsql
1 parent0c5e541 commit28d90a5

File tree

7 files changed

+1491
-0
lines changed

7 files changed

+1491
-0
lines changed

‎src/pl/plpgsql/test/README

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Test suite for PL/pgSQL
2+
3+
Scenario:
4+
5+
A building with a modern TP cabel installation where any
6+
of the wall connectors can be used to plug in phones,
7+
ethernet interfaces or local office hubs. The backside
8+
of the wall connectors is wired to one of several patch-
9+
fields in the building.
10+
11+
In the patchfields, there are hubs and all the slots
12+
representing the wall connectors. In addition there are
13+
slots that can represent a phone line from the central
14+
phone system.
15+
16+
Triggers ensure consistency of the patching information.
17+
18+
Functions are used to build up powerful views that let
19+
you look behind the wall when looking at a patchfield
20+
or into a room.
21+
22+

‎src/pl/plpgsql/test/mklang.sql

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--
2+
-- PL/pgSQL language declaration
3+
--
4+
-- $Header: /cvsroot/pgsql/src/pl/plpgsql/test/Attic/mklang.sql,v 1.1 1998/08/24 19:16:27 momjian Exp $
5+
--
6+
7+
createfunctionplpgsql_call_handler() returns opaque
8+
as'/usr/local/pgsql/lib/plpgsql.so'
9+
language'C';
10+
11+
create trusted procedural language'plpgsql'
12+
handler plpgsql_call_handler
13+
lancompiler'PL/pgSQL';
14+

‎src/pl/plpgsql/test/runtest

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/sh
2+
3+
DB=plpgsql_test
4+
export DB
5+
6+
FRONTEND="psql -n -e -q"
7+
export FRONTEND
8+
9+
echo"*** destroy old$DB database ***"
10+
destroydb$DB
11+
12+
echo"*** create new$DB database ***"
13+
createdb$DB
14+
15+
echo"*** install PL/pgSQL ***"
16+
$FRONTEND -f mklang.sql -d$DB>/dev/null2>&1
17+
18+
echo"*** create tables ***"
19+
$FRONTEND -f tables.sql -d$DB>output/tables.out2>&1
20+
if cmp -s output/tables.out expected/tables.out;then
21+
echo"OK"
22+
else
23+
echo"FAILED"
24+
fi
25+
26+
echo"*** create triggers ***"
27+
$FRONTEND -f triggers.sql -d$DB>output/triggers.out2>&1
28+
if cmp -s output/triggers.out expected/triggers.out;then
29+
echo"OK"
30+
else
31+
echo"FAILED"
32+
fi
33+
34+
echo"*** create views and support functions ***"
35+
$FRONTEND -f views.sql -d$DB>output/views.out2>&1
36+
if cmp -s output/views.out expected/views.out;then
37+
echo"OK"
38+
else
39+
echo"FAILED"
40+
fi
41+
42+
echo"*** running tests ***"
43+
$FRONTEND -f test.sql -d$DB>output/test.out2>&1
44+
if cmp -s output/test.out expected/test.out;then
45+
echo"OK"
46+
else
47+
echo"FAILED"
48+
fi
49+

‎src/pl/plpgsql/test/tables.sql

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
-- ************************************************************
2+
-- *
3+
-- * Tables for the patchfield test of PL/pgSQL
4+
-- *
5+
-- * $Header: /cvsroot/pgsql/src/pl/plpgsql/test/Attic/tables.sql,v 1.1 1998/08/24 19:16:27 momjian Exp $
6+
-- *
7+
-- ************************************************************
8+
9+
createtableRoom (
10+
roomnochar(8),
11+
commenttext
12+
);
13+
14+
createunique indexRoom_rnoon Room using btree (roomno bpchar_ops);
15+
16+
17+
createtableWSlot (
18+
slotnamechar(20),
19+
roomnochar(8),
20+
slotlinkchar(20),
21+
backlinkchar(20)
22+
);
23+
24+
createunique indexWSlot_nameon WSlot using btree (slotname bpchar_ops);
25+
26+
27+
createtablePField (
28+
nametext,
29+
commenttext
30+
);
31+
32+
createunique indexPField_nameon PField using btree (name text_ops);
33+
34+
35+
createtablePSlot (
36+
slotnamechar(20),
37+
pfnametext,
38+
slotlinkchar(20),
39+
backlinkchar(20)
40+
);
41+
42+
createunique indexPSlot_nameon PSlot using btree (slotname bpchar_ops);
43+
44+
45+
createtablePLine (
46+
slotnamechar(20),
47+
phonenumberchar(20),
48+
commenttext,
49+
backlinkchar(20)
50+
);
51+
52+
createunique indexPLine_nameon PLine using btree (slotname bpchar_ops);
53+
54+
55+
createtableHub (
56+
namechar(14),
57+
commenttext,
58+
nslotsinteger
59+
);
60+
61+
createunique indexHub_nameon Hub using btree (name bpchar_ops);
62+
63+
64+
createtableHSlot (
65+
slotnamechar(20),
66+
hubnamechar(14),
67+
slotnointeger,
68+
slotlinkchar(20)
69+
);
70+
71+
createunique indexHSlot_nameon HSlot using btree (slotname bpchar_ops);
72+
createindexHSlot_hubnameon HSlot using btree (hubname bpchar_ops);
73+
74+
75+
createtableSystem (
76+
nametext,
77+
commenttext
78+
);
79+
80+
createunique indexSystem_nameon System using btree (name text_ops);
81+
82+
83+
createtableIFace (
84+
slotnamechar(20),
85+
sysnametext,
86+
ifnametext,
87+
slotlinkchar(20)
88+
);
89+
90+
createunique indexIFace_nameon IFace using btree (slotname bpchar_ops);
91+
92+
93+
createtablePHone (
94+
slotnamechar(20),
95+
commenttext,
96+
slotlinkchar(20)
97+
);
98+
99+
createunique indexPHone_nameon PHone using btree (slotname bpchar_ops);
100+
101+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp