Commit ee28d8b3 authored by Tom Lane's avatar Tom Lane

plpgsql regress tests seem a tad out of date ... repair bit rot.

parent e91932eb
QUERY: create table Room ( create table Room (
roomno char(8), roomno char(8),
comment text comment text
); );
QUERY: create unique index Room_rno on Room using btree (roomno bpchar_ops); create unique index Room_rno on Room using btree (roomno bpchar_ops);
QUERY: create table WSlot ( create table WSlot (
slotname char(20), slotname char(20),
roomno char(8), roomno char(8),
slotlink char(20), slotlink char(20),
backlink char(20) backlink char(20)
); );
QUERY: create unique index WSlot_name on WSlot using btree (slotname bpchar_ops); create unique index WSlot_name on WSlot using btree (slotname bpchar_ops);
QUERY: create table PField ( create table PField (
name text, name text,
comment text comment text
); );
QUERY: create unique index PField_name on PField using btree (name text_ops); create unique index PField_name on PField using btree (name text_ops);
QUERY: create table PSlot ( create table PSlot (
slotname char(20), slotname char(20),
pfname text, pfname text,
slotlink char(20), slotlink char(20),
backlink char(20) backlink char(20)
); );
QUERY: create unique index PSlot_name on PSlot using btree (slotname bpchar_ops); create unique index PSlot_name on PSlot using btree (slotname bpchar_ops);
QUERY: create table PLine ( create table PLine (
slotname char(20), slotname char(20),
phonenumber char(20), phonenumber char(20),
comment text, comment text,
backlink char(20) backlink char(20)
); );
QUERY: create unique index PLine_name on PLine using btree (slotname bpchar_ops); create unique index PLine_name on PLine using btree (slotname bpchar_ops);
QUERY: create table Hub ( create table Hub (
name char(14), name char(14),
comment text, comment text,
nslots integer nslots integer
); );
QUERY: create unique index Hub_name on Hub using btree (name bpchar_ops); create unique index Hub_name on Hub using btree (name bpchar_ops);
QUERY: create table HSlot ( create table HSlot (
slotname char(20), slotname char(20),
hubname char(14), hubname char(14),
slotno integer, slotno integer,
slotlink char(20) slotlink char(20)
); );
QUERY: create unique index HSlot_name on HSlot using btree (slotname bpchar_ops); create unique index HSlot_name on HSlot using btree (slotname bpchar_ops);
QUERY: create index HSlot_hubname on HSlot using btree (hubname bpchar_ops); create index HSlot_hubname on HSlot using btree (hubname bpchar_ops);
QUERY: create table System ( create table System (
name text, name text,
comment text comment text
); );
QUERY: create unique index System_name on System using btree (name text_ops); create unique index System_name on System using btree (name text_ops);
QUERY: create table IFace ( create table IFace (
slotname char(20), slotname char(20),
sysname text, sysname text,
ifname text, ifname text,
slotlink char(20) slotlink char(20)
); );
QUERY: create unique index IFace_name on IFace using btree (slotname bpchar_ops); create unique index IFace_name on IFace using btree (slotname bpchar_ops);
QUERY: create table PHone ( create table PHone (
slotname char(20), slotname char(20),
comment text, comment text,
slotlink char(20) slotlink char(20)
); );
QUERY: create unique index PHone_name on PHone using btree (slotname bpchar_ops); create unique index PHone_name on PHone using btree (slotname bpchar_ops);
This diff is collapsed.
This diff is collapsed.
QUERY: create function pslot_backlink_view(bpchar) create function pslot_backlink_view(bpchar)
returns text as ' returns text as '
<<outer>> <<outer>>
declare declare
...@@ -38,7 +38,7 @@ begin ...@@ -38,7 +38,7 @@ begin
return rec.backlink; return rec.backlink;
end; end;
' language 'plpgsql'; ' language 'plpgsql';
QUERY: create function pslot_slotlink_view(bpchar) create function pslot_slotlink_view(bpchar)
returns text as ' returns text as '
declare declare
psrec record; psrec record;
...@@ -69,7 +69,7 @@ begin ...@@ -69,7 +69,7 @@ begin
return psrec.slotlink; return psrec.slotlink;
end; end;
' language 'plpgsql'; ' language 'plpgsql';
QUERY: create function wslot_slotlink_view(bpchar) create function wslot_slotlink_view(bpchar)
returns text as ' returns text as '
declare declare
rec record; rec record;
...@@ -114,7 +114,7 @@ begin ...@@ -114,7 +114,7 @@ begin
return rec.slotlink; return rec.slotlink;
end; end;
' language 'plpgsql'; ' language 'plpgsql';
QUERY: create view Pfield_v1 as select PF.pfname, PF.slotname, create view Pfield_v1 as select PF.pfname, PF.slotname,
pslot_backlink_view(PF.slotname) as backside, pslot_backlink_view(PF.slotname) as backside,
pslot_slotlink_view(PF.slotname) as patch pslot_slotlink_view(PF.slotname) as patch
from PSlot PF; from PSlot PF;
--
-- PL/pgSQL language declaration
--
-- $Header: /cvsroot/pgsql/src/pl/plpgsql/test/Attic/mklang.sql,v 1.1 1998/08/24 19:16:27 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';
...@@ -3,17 +3,17 @@ ...@@ -3,17 +3,17 @@
DB=plpgsql_test DB=plpgsql_test
export DB export DB
FRONTEND="psql -n -e -q" FRONTEND="psql -e -q -X"
export FRONTEND export FRONTEND
echo "*** destroy old $DB database ***" echo "*** destroy old $DB database ***"
destroydb $DB dropdb $DB
echo "*** create new $DB database ***" echo "*** create new $DB database ***"
createdb $DB createdb $DB
echo "*** install PL/pgSQL ***" echo "*** install PL/pgSQL ***"
$FRONTEND -f mklang.sql -d $DB >/dev/null 2>&1 createlang plpgsql $DB
echo "*** create tables ***" echo "*** create tables ***"
$FRONTEND -f tables.sql -d $DB >output/tables.out 2>&1 $FRONTEND -f tables.sql -d $DB >output/tables.out 2>&1
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
-- * Trigger procedures and functions for the patchfield -- * Trigger procedures and functions for the patchfield
-- * test of PL/pgSQL -- * test of PL/pgSQL
-- * -- *
-- * $Header: /cvsroot/pgsql/src/pl/plpgsql/test/Attic/triggers.sql,v 1.1 1998/08/24 19:16:27 momjian Exp $ -- * $Header: /cvsroot/pgsql/src/pl/plpgsql/test/Attic/triggers.sql,v 1.2 2000/10/22 23:25:11 tgl Exp $
-- * -- *
-- ************************************************************ -- ************************************************************
...@@ -603,7 +603,7 @@ begin ...@@ -603,7 +603,7 @@ begin
if mytype = ''PS'' then if mytype = ''PS'' then
select into rec * from PSlot where slotname = myname; select into rec * from PSlot where slotname = myname;
if not found then if not found then
raise exception ''% does not exists'', myname; raise exception ''% does not exist'', myname;
end if; end if;
if rec.backlink != blname then if rec.backlink != blname then
update PSlot set backlink = blname where slotname = myname; update PSlot set backlink = blname where slotname = myname;
...@@ -613,7 +613,7 @@ begin ...@@ -613,7 +613,7 @@ begin
if mytype = ''WS'' then if mytype = ''WS'' then
select into rec * from WSlot where slotname = myname; select into rec * from WSlot where slotname = myname;
if not found then if not found then
raise exception ''% does not exists'', myname; raise exception ''% does not exist'', myname;
end if; end if;
if rec.backlink != blname then if rec.backlink != blname then
update WSlot set backlink = blname where slotname = myname; update WSlot set backlink = blname where slotname = myname;
...@@ -623,7 +623,7 @@ begin ...@@ -623,7 +623,7 @@ begin
if mytype = ''PL'' then if mytype = ''PL'' then
select into rec * from PLine where slotname = myname; select into rec * from PLine where slotname = myname;
if not found then if not found then
raise exception ''% does not exists'', myname; raise exception ''% does not exist'', myname;
end if; end if;
if rec.backlink != blname then if rec.backlink != blname then
update PLine set backlink = blname where slotname = myname; update PLine set backlink = blname where slotname = myname;
...@@ -771,7 +771,7 @@ begin ...@@ -771,7 +771,7 @@ begin
if mytype = ''PS'' then if mytype = ''PS'' then
select into rec * from PSlot where slotname = myname; select into rec * from PSlot where slotname = myname;
if not found then if not found then
raise exception ''% does not exists'', myname; raise exception ''% does not exist'', myname;
end if; end if;
if rec.slotlink != blname then if rec.slotlink != blname then
update PSlot set slotlink = blname where slotname = myname; update PSlot set slotlink = blname where slotname = myname;
...@@ -781,7 +781,7 @@ begin ...@@ -781,7 +781,7 @@ begin
if mytype = ''WS'' then if mytype = ''WS'' then
select into rec * from WSlot where slotname = myname; select into rec * from WSlot where slotname = myname;
if not found then if not found then
raise exception ''% does not exists'', myname; raise exception ''% does not exist'', myname;
end if; end if;
if rec.slotlink != blname then if rec.slotlink != blname then
update WSlot set slotlink = blname where slotname = myname; update WSlot set slotlink = blname where slotname = myname;
...@@ -791,7 +791,7 @@ begin ...@@ -791,7 +791,7 @@ begin
if mytype = ''IF'' then if mytype = ''IF'' then
select into rec * from IFace where slotname = myname; select into rec * from IFace where slotname = myname;
if not found then if not found then
raise exception ''% does not exists'', myname; raise exception ''% does not exist'', myname;
end if; end if;
if rec.slotlink != blname then if rec.slotlink != blname then
update IFace set slotlink = blname where slotname = myname; update IFace set slotlink = blname where slotname = myname;
...@@ -801,7 +801,7 @@ begin ...@@ -801,7 +801,7 @@ begin
if mytype = ''HS'' then if mytype = ''HS'' then
select into rec * from HSlot where slotname = myname; select into rec * from HSlot where slotname = myname;
if not found then if not found then
raise exception ''% does not exists'', myname; raise exception ''% does not exist'', myname;
end if; end if;
if rec.slotlink != blname then if rec.slotlink != blname then
update HSlot set slotlink = blname where slotname = myname; update HSlot set slotlink = blname where slotname = myname;
...@@ -811,7 +811,7 @@ begin ...@@ -811,7 +811,7 @@ begin
if mytype = ''PH'' then if mytype = ''PH'' then
select into rec * from PHone where slotname = myname; select into rec * from PHone where slotname = myname;
if not found then if not found then
raise exception ''% does not exists'', myname; raise exception ''% does not exist'', myname;
end if; end if;
if rec.slotlink != blname then if rec.slotlink != blname then
update PHone set slotlink = blname where slotname = myname; update PHone set slotlink = blname where slotname = myname;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment