=============== destroying old video database... =================
WARN:Jan 26 19:07:28:destroydb: database video does not exist.
/private/aoki/postgres//bin/destroydb: database destroy failed on video.
=============== creating new video database... =================
=============== running video queries... =================
Welcome to the C POSTGRES terminal monitor

Go 
* 
Query sent to backend is "define type city_budget ( internallength = 16,  			  input = int44in,  			  output = int44out,  			  element = int4) "
DEFINE
Go 
* 
Query sent to backend is "create person (name = char16, age = int4, location = point) "
CREATE
Go 
* 
Query sent to backend is "create emp (salary = int4, dept = char16) inherits (person) "
CREATE
Go 
* 
Query sent to backend is "create student (gpa = float8) inherits (person) "
CREATE
Go 
* 
Query sent to backend is "create stud_emp (percent = int4) inherits (emp, student) "
CREATE
Go 
* 
Query sent to backend is "create dept (dname = char16, mgrname = char16) "
CREATE
Go 
* 
Query sent to backend is "create city (name = char16, location = box, budget = city_budget) "
CREATE
Go 
* 
Query sent to backend is "define function boxarea ( language = "c", 			  returntype = int4)       arg is (box)      as "/private/aoki/postgres/src/regress/video/obj/../obj/boxarea.o" "
DEFINE
Go 
* 
Query sent to backend is "define function overpaid ( language = "c", 			   returntype = bool)      arg is (emp)     as "/private/aoki/postgres/src/regress/video/obj/../obj/overpaid.o" "
DEFINE
Go 
* 
Query sent to backend is "load "/private/aoki/postgres/src/regress/video/obj/../obj/overpaid.o" "
LOAD
Go 
* 
Query sent to backend is "load "/private/aoki/postgres/src/regress/video/obj/../obj/boxarea.o" "
LOAD
Go 
* 
Query sent to backend is "append person (name = "mike", age = 40, location = "(3.1,6.2)"::point) "
APPEND 147963
Go 
* 
Query sent to backend is "append person (name = "joe", age = 20, location = "(5.5,2.5)"::point) "
APPEND 147964
Go 
* 
Query sent to backend is "append person (name = "greg", age = 50, location = "(5.0,2.0)"::point) "
APPEND 147965
Go 
* 
Query sent to backend is "append person (name = "bob", age = 18, location = "(0.0,0.0)"::point) "
APPEND 147966
Go 
* 
Query sent to backend is "append dept (dname = "toy", mgrname = "sharon") "
APPEND 147967
Go 
* 
Query sent to backend is "append dept (dname = "shoe", mgrname = "bob") "
APPEND 147968
Go 
* 
Query sent to backend is "append emp (name = "bill", age = 20,  location = "(11.0,10.0)"::point, salary = 1000, dept = "toy") "
APPEND 147969
Go 
* 
Query sent to backend is "append emp (name = "sharon", age = 25,  location = "(15.0,12.0)"::point, salary = 500, dept = "shoe") "
APPEND 147970
Go 
* 
Query sent to backend is "append emp (name = "sam", age = 30,  location = "(10.0,5.0)"::point, salary = 300, dept = "toy") "
APPEND 147971
Go 
* 
Query sent to backend is "append student (name = "fred", age = 28, location = "(3.1,-1.5)"::point, gpa = 3.7) "
APPEND 147972
Go 
* 
Query sent to backend is "append student (name = "larry", age = 60, location = "(21.8,4.9)"::point, gpa = 3.1) "
APPEND 147973
Go 
* 
Query sent to backend is "append stud_emp (name = "jeff", age = 23,  location = "(8.0,7.7)"::point, salary = 600, dept = "candy", gpa = 3.5) "
APPEND 147974
Go 
* 
Query sent to backend is "append stud_emp (name = "cim", age = 30, location = "(10.5,4.7)"::point,  salary = 400, dept = "shoe", gpa = 3.4) "
APPEND 147975
Go 
* 
Query sent to backend is "append stud_emp (name = "linda", age = 19, location = "(0.9,6.1)"::point,  salary = 100, dept = "candy", gpa = 2.9) "
APPEND 147976
Go 
* 
Query sent to backend is "append city (name = "berkeley", location = "(0.0,0.0,10.0,10.0)"::box,  budget = "250, 300, 325, 275"::city_budget) "
APPEND 147977
Go 
* 
Query sent to backend is "append city (name = "oakland", location = "(-10.0,-10.0,0.0,5.0)"::box, budget = "600, 400, 350, 500"::city_budget) "
APPEND 147978
Go 
* 
Query sent to backend is "append city (name = "elcerrito", location = "(10.0,0.0, 20.0,10.0)"::box, budget = "100, 100, 100, 100"::city_budget) "
APPEND 147979
Go 
* 
Query sent to backend is "append city (name = "richmond", location = "(20.0,5.0, 35.0,15.0)"::box, budget = "300, 320, 340, 360"::city_budget) "
APPEND 147980
Go 
* 
Query sent to backend is "append city (name = "sanpablo", location = "(35.0,20.0,40.0,30.0)"::box, budget = "50, 60, 65, 70"::city_budget) "
APPEND 147981
Go 
* 
Query sent to backend is "create slow_emp4000 (location = box) "
CREATE
Go 
* 
Query sent to backend is "create fast_emp4000 (location = box) "
CREATE
Go 
* 
Query sent to backend is "copy slow_emp4000 from "/private/aoki/postgres/src/regress/video/obj/../../data/rect.data" "
COPY
Go 
* 
Query sent to backend is "copy fast_emp4000 from "/private/aoki/postgres/src/regress/video/obj/../../data/rect.data" "
COPY
Go 
* 
Query sent to backend is "define index rect2ind on fast_emp4000 using rtree (location bigbox_ops) "
DEFINE
Go 
* 
Query sent to backend is "retrieve (emp.all) "
-----------------------------------------------------------------------
| location    | age         | name        | salary      | dept        |
-----------------------------------------------------------------------
| (11,10)     | 20          | bill        | 1000        | toy         |
-----------------------------------------------------------------------
| (15,12)     | 25          | sharon      | 500         | shoe        |
-----------------------------------------------------------------------
| (10,5)      | 30          | sam         | 300         | toy         |
-----------------------------------------------------------------------

Go 
* 
Query sent to backend is "retrieve (dept.all) "
-----------------------------
| dname       | mgrname     |
-----------------------------
| toy         | sharon      |
-----------------------------
| shoe        | bob         |
-----------------------------

Go 
* 
Query sent to backend is " retrieve (e.name)  from e in emp, m in emp, d in dept where e.dept = d.dname  and d.mgrname = m.name and e.salary > m.salary "
---------------
| name        |
---------------
| bill        |
---------------

Go 
* 
Query sent to backend is "retrieve (city.all) "
-------------------------------------------
| name        | location    | budget      |
-------------------------------------------
| berkeley    | (10,10,0,0) | 250 300 325 275|
-------------------------------------------
| oakland     | (0,5,-10,-10)| 600 400 350 500|
-------------------------------------------
| elcerrito   | (20,10,10,0)| 100 100 100 100|
-------------------------------------------
| richmond    | (35,15,20,5)| 300 320 340 360|
-------------------------------------------
| sanpablo    | (40,30,35,20)| 50 60 65 70 |
-------------------------------------------

Go 
* 
Query sent to backend is "  retrieve (city.name)  where boxarea(city.location) > 100 "
---------------
| name        |
---------------
| oakland     |
---------------
| richmond    |
---------------

Go 
* 
Query sent to backend is "  retrieve (emp.name) where overpaid(emp) "
---------------
| name        |
---------------
| bill        |
---------------

Go 
* 
Query sent to backend is " retrieve (stud_emp.all) where overpaid (stud_emp) "
---------------------------------------------------------------------------------------------------
| gpa         | dept        | salary      | name        | age         | location    | percent     |
---------------------------------------------------------------------------------------------------

Go 
* 
Query sent to backend is "  retrieve (c1.name, c2.name) from c1 in city, c2 in city where c1.location && c2.location "
-----------------------------
| name        | name        |
-----------------------------
| berkeley    | berkeley    |
-----------------------------
| oakland     | berkeley    |
-----------------------------
| elcerrito   | berkeley    |
-----------------------------
| berkeley    | oakland     |
-----------------------------
| oakland     | oakland     |
-----------------------------
| berkeley    | elcerrito   |
-----------------------------
| elcerrito   | elcerrito   |
-----------------------------
| richmond    | elcerrito   |
-----------------------------
| elcerrito   | richmond    |
-----------------------------
| richmond    | richmond    |
-----------------------------
| sanpablo    | sanpablo    |
-----------------------------

Go 
* 
Query sent to backend is "  retrieve (fast_emp4000.all) where fast_emp4000.location && "(24000,24000,26000,26000)" "
---------------
| location    |
---------------
| (24497,24752,24411,24710)|
---------------
| (24738,25458,24656,25362)|
---------------
| (24704,25422,24635,25340)|
---------------
| (25345,24019,25313,24017)|
---------------
| (25051,25042,25011,25001)|
---------------
| (25044,25088,25015,25005)|
---------------
| (25007,25061,25002,25013)|
---------------
| (25066,25105,25003,25007)|
---------------
| (25028,25012,25015,25011)|
---------------
| (25031,25057,25006,25018)|
---------------
| (25015,25042,25004,25012)|
---------------
| (25091,25049,25019,25019)|
---------------
| (25023,25011,25000,25004)|
---------------
| (25053,25104,25010,25012)|
---------------
| (25058,25001,25018,25000)|
---------------
| (25059,25051,25008,25016)|
---------------
| (25043,25069,25007,25004)|
---------------
| (25006,25101,25002,25002)|
---------------
| (25095,25012,25014,25007)|
---------------
| (25054,25052,25019,25013)|
---------------
| (25108,25077,25009,25018)|
---------------
| (25007,25023,25003,25002)|
---------------
| (25076,25098,25002,25016)|
---------------
| (25030,25077,25012,25006)|
---------------

Go 
* 
Query sent to backend is "  retrieve (slow_emp4000.all) where slow_emp4000.location && "(24000,24000,26000,26000)" "
---------------
| location    |
---------------
| (24497,24752,24411,24710)|
---------------
| (24738,25458,24656,25362)|
---------------
| (24704,25422,24635,25340)|
---------------
| (25345,24019,25313,24017)|
---------------
| (25051,25042,25011,25001)|
---------------
| (25044,25088,25015,25005)|
---------------
| (25007,25061,25002,25013)|
---------------
| (25066,25105,25003,25007)|
---------------
| (25028,25012,25015,25011)|
---------------
| (25031,25057,25006,25018)|
---------------
| (25015,25042,25004,25012)|
---------------
| (25091,25049,25019,25019)|
---------------
| (25023,25011,25000,25004)|
---------------
| (25053,25104,25010,25012)|
---------------
| (25058,25001,25018,25000)|
---------------
| (25059,25051,25008,25016)|
---------------
| (25043,25069,25007,25004)|
---------------
| (25006,25101,25002,25002)|
---------------
| (25095,25012,25014,25007)|
---------------
| (25054,25052,25019,25013)|
---------------
| (25108,25077,25009,25018)|
---------------
| (25007,25023,25003,25002)|
---------------
| (25076,25098,25002,25016)|
---------------
| (25030,25077,25012,25006)|
---------------

Go 
* 
Query sent to backend is "define rule example_1 is on replace to emp.salary where current.name = "bill" do replace emp (salary = new.salary) where emp.name = "sam" "
DEFINE
Go 
* 
Query sent to backend is "retrieve (emp.salary) where emp.name = "sam" "
---------------
| salary      |
---------------
| 300         |
---------------

Go 
* 
Query sent to backend is "replace emp (salary = 6000) where emp.name = "bill" "
REPLACE
Go 
* 
Query sent to backend is "retrieve (emp.salary) where emp.name = "sam" "
---------------
| salary      |
---------------
| 6000        |
---------------

Go 
* 
Query sent to backend is "define view toyemp (emp.name, emp.age, emp.location, annualsal = 12*emp.salary) where emp.dept = "toy" "
APPEND 154383DEFINE
Go 
* 
Query sent to backend is "retrieve (toyemp.all) "
---------------------------------------------------------
| name        | age         | location    | annualsal   |
---------------------------------------------------------
| sam         | 30          | (10,5)      | 72000       |
---------------------------------------------------------
| bill        | 20          | (11,10)     | 72000       |
---------------------------------------------------------

Go 
* 
Query sent to backend is " create toyemp2(name = char16, age = int4, location = point, annualsal = int4) "
CREATE
Go 
* 
Query sent to backend is "define rewrite rule toyemp2_ret is on retrieve to toyemp2 do instead retrieve(emp.name, emp.age, emp.location, annualsal = 12*emp.salary) where emp.dept = "toy" "
APPEND 154456DEFINE
Go 
* 
Query sent to backend is "retrieve (toyemp2.all) "
---------------------------------------------------------
| name        | age         | location    | annualsal   |
---------------------------------------------------------
| sam         | 30          | (10,5)      | 72000       |
---------------------------------------------------------
| bill        | 20          | (11,10)     | 72000       |
---------------------------------------------------------

Go 
* 
Query sent to backend is " define rewrite rule toyemp_app is on append to toyemp do instead append emp(name = new.name, age = new.age, location = new.location, 	dept = "toy", salary = new.annualsal/12) "
APPEND 154459DEFINE
Go 
* 
Query sent to backend is "append toyemp(name="spyros", age=28, 	location="(6,27)", annualsal = 48000) "
APPEND 154462
Go 
* 
Query sent to backend is "retrieve (toyemp.all) "
---------------------------------------------------------
| name        | age         | location    | annualsal   |
---------------------------------------------------------
| sam         | 30          | (10,5)      | 72000       |
---------------------------------------------------------
| bill        | 20          | (11,10)     | 72000       |
---------------------------------------------------------
| spyros      | 28          | (6,27)      | 48000       |
---------------------------------------------------------

Go 
* 
Query sent to backend is "retrieve (emp.all) "
-----------------------------------------------------------------------
| location    | age         | name        | salary      | dept        |
-----------------------------------------------------------------------
| (15,12)     | 25          | sharon      | 500         | shoe        |
-----------------------------------------------------------------------
| (10,5)      | 30          | sam         | 6000        | toy         |
-----------------------------------------------------------------------
| (11,10)     | 20          | bill        | 6000        | toy         |
-----------------------------------------------------------------------
| (6,27)      | 28          | spyros      | 4000        | toy         |
-----------------------------------------------------------------------

Go 
* 
Query sent to backend is "create version emp1 from emp "
RETRIEVERETRIEVECREATEAPPEND 154671DEFINEAPPEND 154674DEFINEAPPEND 154677DEFINEAPPEND 154680DEFINEVERSION
Go 
* 
Query sent to backend is "  append emp1 (name = "jack", age = 40, salary = 20000, dept = "shoe") "
APPEND 154683
Go 
* 
Query sent to backend is "append emp1 (name = "joe", age = 25, salary = 3000, dept = "shoe") "
APPEND 154684
Go 
* 
Query sent to backend is "  replace emp1 (salary = 5000) where emp1.name = "bill" "
REPLACEAPPEND 0APPEND 0
Go 
* 
Query sent to backend is " replace emp1 (salary = 2500) where emp1.name = "joe" and emp1.dept = "shoe" "
REPLACEAPPEND 0APPEND 0
Go 
* 
Query sent to backend is " delete emp1 where emp1.dept = "toy" "
DELETEAPPEND 0
Go 
* 
Query sent to backend is " retrieve (emp1.all) "
-----------------------------------------------------------------------
| location    | age         | name        | salary      | dept        |
-----------------------------------------------------------------------
| (15,12)     | 25          | sharon      | 500         | shoe        |
-----------------------------------------------------------------------
| (null)      | 40          | jack        | 20000       | shoe        |
-----------------------------------------------------------------------
| (null)      | 25          | joe         | 2500        | shoe        |
-----------------------------------------------------------------------

Go 
* 
Query sent to backend is " retrieve (emp.all) "
-----------------------------------------------------------------------
| location    | age         | name        | salary      | dept        |
-----------------------------------------------------------------------
| (15,12)     | 25          | sharon      | 500         | shoe        |
-----------------------------------------------------------------------
| (10,5)      | 30          | sam         | 6000        | toy         |
-----------------------------------------------------------------------
| (11,10)     | 20          | bill        | 6000        | toy         |
-----------------------------------------------------------------------
| (6,27)      | 28          | spyros      | 4000        | toy         |
-----------------------------------------------------------------------

Go 
* 
Query sent to backend is " retrieve (emp1_added.all) "
-----------------------------------------------------------------------
| location    | age         | name        | salary      | dept        |
-----------------------------------------------------------------------
| (null)      | 40          | jack        | 20000       | shoe        |
-----------------------------------------------------------------------
| (null)      | 25          | joe         | 2500        | shoe        |
-----------------------------------------------------------------------

Go 
* 
Query sent to backend is " retrieve (emp1_del.all) "
---------------
| DOID        |
---------------
| 147969      |
---------------
| 147969      |
---------------
| 147971      |
---------------
| 154462      |
---------------

Go 
* 
Query sent to backend is "  create emp2(salary = int4, dept = char16, 		location = point, age = int4, name = char16) "
CREATE
Go 
* 
Go 
* 
Query sent to backend is "create emp2_added(salary = int4, dept = char16, 		location = point, age = int4, name = char16) "
CREATE
Go 
* 
Go 
* 
Query sent to backend is "create emp2_del(DOID = oid) "
CREATE
Go 
* 
Go 
* 
Query sent to backend is "define rewrite rule emp2_retrieve is on retrieve to emp2 do instead retrieve(emp2_1.oid, emp2_1.all) from _emp in emp, emp2_1 in (emp2_added | _emp) where _emp.oid !!= "emp2_del.DOID" "
APPEND 154896DEFINE
Go 
* 
Go 
* 
Query sent to backend is "define rewrite rule emp2_append is on append to emp2 do instead append emp2_added(salary = new.salary, dept = new.dept, 		location = new.location, age = new.age, name = new.name) "
APPEND 154899DEFINE
Go 
* 
Go 
* 
Query sent to backend is "define rewrite rule emp2_delete1 is on delete to emp2 do delete emp2_added where current.oid = emp2_added.oid "
APPEND 154902DEFINE
Go 
* 
Go 
* 
Query sent to backend is "define rewrite rule emp2_delete2 is on delete to emp2 do instead append emp2_del(DOID = current.oid) where current.oid = emp.oid "
APPEND 154905DEFINE
Go 
* 
Go 
* 
Query sent to backend is "define rewrite rule emp2_replace1 is on replace to emp2 do replace emp2_added(salary = new.salary, dept = new.dept, 		location = new.location, age = new.age, name = new.name) where current.oid = emp2_added.oid "
APPEND 154908DEFINE
Go 
* 
Go 
* 
Query sent to backend is "define rewrite rule emp2_replace2 is on replace to emp2 do append emp2_del(DOID = current.oid) where current.oid = emp.oid "
APPEND 154911DEFINE
Go 
* 
Go 
* 
Query sent to backend is "define rewrite rule emp2_replace3 is on replace to emp2 do instead append emp2_added(salary = new.salary, dept = new.dept, 		location = new.location, age = new.age, name = new.name) where current.oid !!= "emp2_added.oid" and current.oid = emp.oid "
APPEND 154914DEFINE
Go 
* 
Go 
* 
Query sent to backend is "  define function manager (language = "postquel", returntype = emp)     arg is (emp)     as "retrieve (emp.all) where emp.name = dept.mgrname 				and dept.dname = $1.dept" "
DEFINE
Go 
* 
Query sent to backend is "  retrieve (mgr_name = name(manager(emp))) "
---------------
| mgr_name    |
---------------
| (null)      |
---------------
| sharon      |
---------------
| sharon      |
---------------
| sharon      |
---------------

Go 
* 
Query sent to backend is " "

Go 
* 
Query sent to backend is "retrieve (emp.manager.name) "
---------------
| name        |
---------------
| (null)      |
---------------
| sharon      |
---------------
| sharon      |
---------------
| sharon      |
---------------

Go 
* 
Query sent to backend is " "

Go 
* 
Query sent to backend is "        define function raise_sal (language = "postquel", returntype = bool)     arg is (char16, int4)     as "replace e (salary = e.salary + $2) from e in emp 		where e.name = $1 	retrieve (x = \"t\"::bool)"  "
DEFINE
Go 
* 
Query sent to backend is " "

Go 
* 
Query sent to backend is " retrieve (x = raise_sal("sam"::char16, 100)) "
---------------
| x           |
---------------
| t           |
---------------

Go 
* 
Query sent to backend is " "

Go 
* 
Query sent to backend is "  define function residents ( language = "postquel", 			    returntype = setof person )     arg is (city)     as  "retrieve (p.all) from p in person* 	 where p.location ---> $1.location" "
DEFINE
Go 
* 
Query sent to backend is "  retrieve (city.residents.name) where city.name = "berkeley" "
---------------
| name        |
---------------
| mike        |
---------------
| joe         |
---------------
| greg        |
---------------
| bob         |
---------------
| sam         |
---------------
| jeff        |
---------------
| linda       |
---------------

Go 
* I live to serve you.
=============== destroying video database... =================
