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
0c5e541a
Commit
0c5e541a
authored
Aug 24, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move plpgsql to src/pl for Jan.
parent
9b73210f
Changes
21
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
8 additions
and
1499 deletions
+8
-1499
contrib/plpgsql/test/README
contrib/plpgsql/test/README
+0
-22
contrib/plpgsql/test/mklang.sql
contrib/plpgsql/test/mklang.sql
+0
-14
contrib/plpgsql/test/runtest
contrib/plpgsql/test/runtest
+0
-49
contrib/plpgsql/test/tables.sql
contrib/plpgsql/test/tables.sql
+0
-101
contrib/plpgsql/test/test.sql
contrib/plpgsql/test/test.sql
+0
-272
contrib/plpgsql/test/triggers.sql
contrib/plpgsql/test/triggers.sql
+0
-892
contrib/plpgsql/test/views.sql
contrib/plpgsql/test/views.sql
+0
-141
src/pl/plpgsql/doc/plpgsql.txt
src/pl/plpgsql/doc/plpgsql.txt
+0
-0
src/pl/plpgsql/src/INSTALL
src/pl/plpgsql/src/INSTALL
+0
-0
src/pl/plpgsql/src/gram.y
src/pl/plpgsql/src/gram.y
+1
-1
src/pl/plpgsql/src/mklang.sql
src/pl/plpgsql/src/mklang.sql
+1
-1
src/pl/plpgsql/src/pl_comp.c
src/pl/plpgsql/src/pl_comp.c
+1
-1
src/pl/plpgsql/src/pl_exec.c
src/pl/plpgsql/src/pl_exec.c
+1
-1
src/pl/plpgsql/src/pl_funcs.c
src/pl/plpgsql/src/pl_funcs.c
+1
-1
src/pl/plpgsql/src/pl_handler.c
src/pl/plpgsql/src/pl_handler.c
+1
-1
src/pl/plpgsql/src/plpgsql.h
src/pl/plpgsql/src/plpgsql.h
+1
-1
src/pl/plpgsql/src/scan.l
src/pl/plpgsql/src/scan.l
+1
-1
src/pl/plpgsql/test/expected/tables.out
src/pl/plpgsql/test/expected/tables.out
+0
-0
src/pl/plpgsql/test/expected/test.out
src/pl/plpgsql/test/expected/test.out
+0
-0
src/pl/plpgsql/test/expected/triggers.out
src/pl/plpgsql/test/expected/triggers.out
+0
-0
src/pl/plpgsql/test/expected/views.out
src/pl/plpgsql/test/expected/views.out
+0
-0
No files found.
contrib/plpgsql/test/README
deleted
100644 → 0
View file @
9b73210f
Test suite for PL/pgSQL
Scenario:
A building with a modern TP cabel installation where any
of the wall connectors can be used to plug in phones,
ethernet interfaces or local office hubs. The backside
of the wall connectors is wired to one of several patch-
fields in the building.
In the patchfields, there are hubs and all the slots
representing the wall connectors. In addition there are
slots that can represent a phone line from the central
phone system.
Triggers ensure consistency of the patching information.
Functions are used to build up powerful views that let
you look behind the wall when looking at a patchfield
or into a room.
contrib/plpgsql/test/mklang.sql
deleted
100644 → 0
View file @
9b73210f
--
-- PL/pgSQL language declaration
--
-- $Header: /cvsroot/pgsql/contrib/plpgsql/test/Attic/mklang.sql,v 1.1 1998/08/22 12:38:36 momjian Exp $
--
create
function
plpgsql_call_handler
()
returns
opaque
as
'/usr/local/pgsql/lib/plpgsql.so'
language
'C'
;
create
trusted
procedural
language
'plpgsql'
handler
plpgsql_call_handler
lancompiler
'PL/pgSQL'
;
contrib/plpgsql/test/runtest
deleted
100755 → 0
View file @
9b73210f
#!/bin/sh
DB
=
plpgsql_test
export
DB
FRONTEND
=
"psql -n -e -q"
export
FRONTEND
echo
"*** destroy old
$DB
database ***"
destroydb
$DB
echo
"*** create new
$DB
database ***"
createdb
$DB
echo
"*** install PL/pgSQL ***"
$FRONTEND
-f
mklang.sql
-d
$DB
>
/dev/null 2>&1
echo
"*** create tables ***"
$FRONTEND
-f
tables.sql
-d
$DB
>
output/tables.out 2>&1
if
cmp
-s
output/tables.out expected/tables.out
;
then
echo
"OK"
else
echo
"FAILED"
fi
echo
"*** create triggers ***"
$FRONTEND
-f
triggers.sql
-d
$DB
>
output/triggers.out 2>&1
if
cmp
-s
output/triggers.out expected/triggers.out
;
then
echo
"OK"
else
echo
"FAILED"
fi
echo
"*** create views and support functions ***"
$FRONTEND
-f
views.sql
-d
$DB
>
output/views.out 2>&1
if
cmp
-s
output/views.out expected/views.out
;
then
echo
"OK"
else
echo
"FAILED"
fi
echo
"*** running tests ***"
$FRONTEND
-f
test.sql
-d
$DB
>
output/test.out 2>&1
if
cmp
-s
output/test.out expected/test.out
;
then
echo
"OK"
else
echo
"FAILED"
fi
contrib/plpgsql/test/tables.sql
deleted
100644 → 0
View file @
9b73210f
-- ************************************************************
-- *
-- * Tables for the patchfield test of PL/pgSQL
-- *
-- * $Header: /cvsroot/pgsql/contrib/plpgsql/test/Attic/tables.sql,v 1.1 1998/08/22 12:38:36 momjian Exp $
-- *
-- ************************************************************
create
table
Room
(
roomno
char
(
8
),
comment
text
);
create
unique
index
Room_rno
on
Room
using
btree
(
roomno
bpchar_ops
);
create
table
WSlot
(
slotname
char
(
20
),
roomno
char
(
8
),
slotlink
char
(
20
),
backlink
char
(
20
)
);
create
unique
index
WSlot_name
on
WSlot
using
btree
(
slotname
bpchar_ops
);
create
table
PField
(
name
text
,
comment
text
);
create
unique
index
PField_name
on
PField
using
btree
(
name
text_ops
);
create
table
PSlot
(
slotname
char
(
20
),
pfname
text
,
slotlink
char
(
20
),
backlink
char
(
20
)
);
create
unique
index
PSlot_name
on
PSlot
using
btree
(
slotname
bpchar_ops
);
create
table
PLine
(
slotname
char
(
20
),
phonenumber
char
(
20
),
comment
text
,
backlink
char
(
20
)
);
create
unique
index
PLine_name
on
PLine
using
btree
(
slotname
bpchar_ops
);
create
table
Hub
(
name
char
(
14
),
comment
text
,
nslots
integer
);
create
unique
index
Hub_name
on
Hub
using
btree
(
name
bpchar_ops
);
create
table
HSlot
(
slotname
char
(
20
),
hubname
char
(
14
),
slotno
integer
,
slotlink
char
(
20
)
);
create
unique
index
HSlot_name
on
HSlot
using
btree
(
slotname
bpchar_ops
);
create
index
HSlot_hubname
on
HSlot
using
btree
(
hubname
bpchar_ops
);
create
table
System
(
name
text
,
comment
text
);
create
unique
index
System_name
on
System
using
btree
(
name
text_ops
);
create
table
IFace
(
slotname
char
(
20
),
sysname
text
,
ifname
text
,
slotlink
char
(
20
)
);
create
unique
index
IFace_name
on
IFace
using
btree
(
slotname
bpchar_ops
);
create
table
PHone
(
slotname
char
(
20
),
comment
text
,
slotlink
char
(
20
)
);
create
unique
index
PHone_name
on
PHone
using
btree
(
slotname
bpchar_ops
);
contrib/plpgsql/test/test.sql
deleted
100644 → 0
View file @
9b73210f
This diff is collapsed.
Click to expand it.
contrib/plpgsql/test/triggers.sql
deleted
100644 → 0
View file @
9b73210f
This diff is collapsed.
Click to expand it.
contrib/plpgsql/test/views.sql
deleted
100644 → 0
View file @
9b73210f
-- ************************************************************
-- * Describe the backside of a patchfield slot
-- ************************************************************
create
function
pslot_backlink_view
(
bpchar
)
returns
text
as
'
<<outer>>
declare
rec record;
bltype char(2);
retval text;
begin
select into rec * from PSlot where slotname = $1;
if not found then
return
''''
;
end if;
if rec.backlink =
''''
then
return
''
-
''
;
end if;
bltype := substr(rec.backlink, 1, 2);
if bltype =
''
PL
''
then
declare
rec record;
begin
select into rec * from PLine where slotname = outer.rec.backlink;
retval :=
''
Phone line
''
|| trim(rec.phonenumber);
if rec.comment !=
''''
then
retval := retval ||
''
(
''
;
retval := retval || rec.comment;
retval := retval ||
''
)
''
;
end if;
return retval;
end;
end if;
if bltype =
''
WS
''
then
select into rec * from WSlot where slotname = rec.backlink;
retval := trim(rec.slotname) ||
''
in room
''
;
retval := retval || trim(rec.roomno);
retval := retval ||
''
->
''
;
return retval || wslot_slotlink_view(rec.slotname);
end if;
return rec.backlink;
end;
'
language
'plpgsql'
;
-- ************************************************************
-- * Describe the front of a patchfield slot
-- ************************************************************
create
function
pslot_slotlink_view
(
bpchar
)
returns
text
as
'
declare
psrec record;
sltype char(2);
retval text;
begin
select into psrec * from PSlot where slotname = $1;
if not found then
return
''''
;
end if;
if psrec.slotlink =
''''
then
return
''
-
''
;
end if;
sltype := substr(psrec.slotlink, 1, 2);
if sltype =
''
PS
''
then
retval := trim(psrec.slotlink) ||
''
->
''
;
return retval || pslot_backlink_view(psrec.slotlink);
end if;
if sltype =
''
HS
''
then
retval := comment from Hub H, HSlot HS
where HS.slotname = psrec.slotlink
and H.name = HS.hubname;
retval := retval ||
''
slot
''
;
retval := retval || slotno::text from HSlot
where slotname = psrec.slotlink;
return retval;
end if;
return psrec.slotlink;
end;
'
language
'plpgsql'
;
-- ************************************************************
-- * Describe the front of a wall connector slot
-- ************************************************************
create
function
wslot_slotlink_view
(
bpchar
)
returns
text
as
'
declare
rec record;
sltype char(2);
retval text;
begin
select into rec * from WSlot where slotname = $1;
if not found then
return
''''
;
end if;
if rec.slotlink =
''''
then
return
''
-
''
;
end if;
sltype := substr(rec.slotlink, 1, 2);
if sltype =
''
PH
''
then
select into rec * from PHone where slotname = rec.slotlink;
retval :=
''
Phone
''
|| trim(rec.slotname);
if rec.comment !=
''''
then
retval := retval ||
''
(
''
;
retval := retval || rec.comment;
retval := retval ||
''
)
''
;
end if;
return retval;
end if;
if sltype =
''
IF
''
then
declare
syrow System%RowType;
ifrow IFace%ROWTYPE;
begin
select into ifrow * from IFace where slotname = rec.slotlink;
select into syrow * from System where name = ifrow.sysname;
retval := syrow.name ||
''
IF
''
;
retval := retval || ifrow.ifname;
if syrow.comment !=
''''
then
retval := retval ||
''
(
''
;
retval := retval || syrow.comment;
retval := retval ||
''
)
''
;
end if;
return retval;
end;
end if;
return rec.slotlink;
end;
'
language
'plpgsql'
;
-- ************************************************************
-- * View of a patchfield describing backside and patches
-- ************************************************************
create
view
Pfield_v1
as
select
PF
.
pfname
,
PF
.
slotname
,
pslot_backlink_view
(
PF
.
slotname
)
as
backside
,
pslot_slotlink_view
(
PF
.
slotname
)
as
patch
from
PSlot
PF
;
contrib
/plpgsql/doc/plpgsql.txt
→
src/pl
/plpgsql/doc/plpgsql.txt
View file @
0c5e541a
File moved
contrib
/plpgsql/src/INSTALL
→
src/pl
/plpgsql/src/INSTALL
View file @
0c5e541a
File moved
contrib
/plpgsql/src/gram.y
→
src/pl
/plpgsql/src/gram.y
View file @
0c5e541a
...
...
@@ -4,7 +4,7 @@
* procedural language
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/
contrib/plpgsql/src/Attic/gram.y,v 1.1 1998/08/22 12:38:30
momjian Exp $
* $Header: /cvsroot/pgsql/
src/pl/plpgsql/src/gram.y,v 1.1 1998/08/24 19:14:47
momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
...
...
contrib
/plpgsql/src/mklang.sql
→
src/pl
/plpgsql/src/mklang.sql
View file @
0c5e541a
--
-- PL/pgSQL language declaration
--
-- $Header: /cvsroot/pgsql/
contrib/plpgsql/src/Attic/mklang.sql,v 1.1 1998/08/22 12:38:31
momjian Exp $
-- $Header: /cvsroot/pgsql/
src/pl/plpgsql/src/Attic/mklang.sql,v 1.1 1998/08/24 19:14:48
momjian Exp $
--
create
function
plpgsql_call_handler
()
returns
opaque
...
...
contrib
/plpgsql/src/pl_comp.c
→
src/pl
/plpgsql/src/pl_comp.c
View file @
0c5e541a
...
...
@@ -3,7 +3,7 @@
* procedural language
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/
contrib/plpgsql/src/Attic/pl_comp.c,v 1.1 1998/08/22 12:38:32
momjian Exp $
* $Header: /cvsroot/pgsql/
src/pl/plpgsql/src/pl_comp.c,v 1.1 1998/08/24 19:14:48
momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
...
...
contrib
/plpgsql/src/pl_exec.c
→
src/pl
/plpgsql/src/pl_exec.c
View file @
0c5e541a
...
...
@@ -3,7 +3,7 @@
* procedural language
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/
contrib/plpgsql/src/Attic/pl_exec.c,v 1.1 1998/08/22 12:38:32
momjian Exp $
* $Header: /cvsroot/pgsql/
src/pl/plpgsql/src/pl_exec.c,v 1.1 1998/08/24 19:14:48
momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
...
...
contrib
/plpgsql/src/pl_funcs.c
→
src/pl
/plpgsql/src/pl_funcs.c
View file @
0c5e541a
...
...
@@ -3,7 +3,7 @@
* procedural language
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/
contrib/plpgsql/src/Attic/pl_funcs.c,v 1.1 1998/08/22 12:38:32
momjian Exp $
* $Header: /cvsroot/pgsql/
src/pl/plpgsql/src/pl_funcs.c,v 1.1 1998/08/24 19:14:48
momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
...
...
contrib
/plpgsql/src/pl_handler.c
→
src/pl
/plpgsql/src/pl_handler.c
View file @
0c5e541a
...
...
@@ -3,7 +3,7 @@
* procedural language
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/
contrib/plpgsql/src/Attic/pl_handler.c,v 1.1 1998/08/22 12:38:32
momjian Exp $
* $Header: /cvsroot/pgsql/
src/pl/plpgsql/src/pl_handler.c,v 1.1 1998/08/24 19:14:49
momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
...
...
contrib
/plpgsql/src/plpgsql.h
→
src/pl
/plpgsql/src/plpgsql.h
View file @
0c5e541a
...
...
@@ -3,7 +3,7 @@
* procedural language
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/
contrib/plpgsql/src/Attic/plpgsql.h,v 1.1 1998/08/22 12:38:33
momjian Exp $
* $Header: /cvsroot/pgsql/
src/pl/plpgsql/src/plpgsql.h,v 1.1 1998/08/24 19:14:49
momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
...
...
contrib
/plpgsql/src/scan.l
→
src/pl
/plpgsql/src/scan.l
View file @
0c5e541a
...
...
@@ -4,7 +4,7 @@
* procedural language
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/
contrib/plpgsql/src/Attic/scan.l,v 1.1 1998/08/22 12:38:33
momjian Exp $
* $Header: /cvsroot/pgsql/
src/pl/plpgsql/src/Attic/scan.l,v 1.1 1998/08/24 19:14:49
momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
...
...
contrib
/plpgsql/test/expected/tables.out
→
src/pl
/plpgsql/test/expected/tables.out
View file @
0c5e541a
File moved
contrib
/plpgsql/test/expected/test.out
→
src/pl
/plpgsql/test/expected/test.out
View file @
0c5e541a
File moved
contrib
/plpgsql/test/expected/triggers.out
→
src/pl
/plpgsql/test/expected/triggers.out
View file @
0c5e541a
File moved
contrib
/plpgsql/test/expected/views.out
→
src/pl
/plpgsql/test/expected/views.out
View file @
0c5e541a
File moved
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