=============== destroying old demo database... ================= WARN:Jan 8 16:25:35:destroydb: database demo does not exist. /private/aoki/postgres/bin/destroydb: database destroy failed on demo. =============== creating new demo database... ================= =============== running demo queries... ================= Welcome to the C POSTGRES terminal monitor 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, manager = 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 "define type city_budget ( internallength = 16, input = int44in, output = int44out, element = int4) " DEFINE Go * Query sent to backend is "create city (name = char16, location = box, budget = city_budget) " CREATE Go * Query sent to backend is "define function circle_in ( language = "c", returntype = circle ) arg is (char16) as "/private/aoki/postgres/src/regress/demo/obj/../obj/circle.o" " NOTICE:Jan 8 16:25:54:ProcedureDefine: return type 'circle' not yet defined DEFINE Go * Query sent to backend is "define function circle_out ( language = "c", returntype = char16 ) arg is (circle) as "/private/aoki/postgres/src/regress/demo/obj/../obj/circle.o" " DEFINE Go * Query sent to backend is "define function pt_in_circle ( language = "c", returntype = bool) arg is (point, circle) as "/private/aoki/postgres/src/regress/demo/obj/../obj/circle.o" " DEFINE Go * Query sent to backend is "define function overpaid ( language = "c", returntype = bool) arg is (emp) as "/private/aoki/postgres/src/regress/demo/obj/../obj/overpaid.o" " DEFINE Go * Query sent to backend is "define type circle (internallength = 24, input = circle_in, output = circle_out) " DEFINE Go * Query sent to backend is "define function boxarea ( language = "c", returntype = int4) arg is (box) as "/private/aoki/postgres/src/regress/demo/obj/../obj/boxarea.o" " DEFINE Go * Query sent to backend is "load "/private/aoki/postgres/src/regress/demo/obj/../obj/boxarea.o" " LOAD Go * Query sent to backend is "load "/private/aoki/postgres/src/regress/demo/obj/../obj/circle.o" " LOAD Go * Query sent to backend is "load "/private/aoki/postgres/src/regress/demo/obj/../obj/overpaid.o" " LOAD Go * Query sent to backend is "append person (name = "mike", age = 40, location = "(3.1,6.2)") " APPEND 20910 Go * Query sent to backend is "append person (name = "joe", age = 20, location = "(5.5,2.5)") " APPEND 20911 Go * Query sent to backend is "append person (name = "greg", age = 50, location = "(5.0,2.0)") " APPEND 20912 Go * Query sent to backend is "append person (name = "bob", age = 18, location = "(0.0,0.0)") " APPEND 20913 Go * Query sent to backend is "append emp (name = "bill", age = 20, location = "(11.0,10.0)", salary = 1000, manager = "sharon") " APPEND 20914 Go * Query sent to backend is "append emp (name = "sharon", age = 25, location = "(15.0,12.0)", salary = 500, manager = "sam") " APPEND 20915 Go * Query sent to backend is "append emp (name = "sam", age = 30, location = "(10.0,5.0)", salary = 300, manager = "bill") " APPEND 20916 Go * Query sent to backend is "append student (name = "fred", age = 28, location = "(3.1,-1.5)", gpa = 3.7) " APPEND 20917 Go * Query sent to backend is "append student (name = "larry", age = 60, location = "(21.8,4.9)", gpa = 3.1) " APPEND 20918 Go * Query sent to backend is "append stud_emp (name = "jeff", age = 23, location = "(8.0,7.7)", salary = 600, manager = "sharon", gpa = 3.5) " APPEND 20919 Go * Query sent to backend is "append stud_emp (name = "cim", age = 30, location = "(10.5,4.7)", salary = 400, gpa = 3.4) " APPEND 20920 Go * Query sent to backend is "append stud_emp (name = "linda", age = 19, location = "(0.9,6.1)", salary = 100, gpa = 2.9) " APPEND 20921 Go * Query sent to backend is "append city (name = "berkeley", location = "(0.0,0.0,10.0,10.0)", budget = "250, 300, 325, 275") " APPEND 20922 Go * Query sent to backend is "append city (name = "oakland", location = "(-10.0,-10.0,0.0,5.0)", budget = "600, 400, 350, 500") " APPEND 20923 Go * Query sent to backend is "append city (name = "elcerrito", location = "(10.0,0.0, 20.0,10.0)", budget = "100, 100, 100, 100") " APPEND 20924 Go * Query sent to backend is "append city (name = "richmond", location = "(20.0,5.0, 35.0,15.0)", budget = "300, 320, 340, 360") " APPEND 20925 Go * Query sent to backend is "append city (name = "sanpablo", location = "(35.0,20.0,40.0,30.0)", budget = "50, 60, 65, 70") " APPEND 20926 Go * Query sent to backend is "retrieve (emp.all) " ----------------------------------------------------------------------- | location | age | name | salary | manager | ----------------------------------------------------------------------- | (11,10) | 20 | bill | 1000 | sharon | ----------------------------------------------------------------------- | (15,12) | 25 | sharon | 500 | sam | ----------------------------------------------------------------------- | (10,5) | 30 | sam | 300 | 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 (e.name) from e in emp, m in emp where e.manager = m.name and e.salary > m.salary " --------------- | name | --------------- | bill | --------------- | sharon | --------------- 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 (city.name) where city.budget[1] > city.budget[2] " --------------- | name | --------------- | oakland | --------------- Go * Query sent to backend is "retrieve (emp.name) from s in city where s.name = "berkeley" and emp.location ---> s.location " --------------- | name | --------------- | sam | --------------- Go * Query sent to backend is "define operator <% ( arg1 = point, arg2 = circle, procedure = pt_in_circle, associativity = left, commutator = >=%, restrict = int4eq) " DEFINE Go * Query sent to backend is "retrieve (emp.name, emp.location) where emp.location <% "(5.0,5.0,10.0)"::circle " ----------------------------- | name | location | ----------------------------- | bill | (11,10) | ----------------------------- | sam | (10,5) | ----------------------------- Go * Query sent to backend is "retrieve (emp.salary) where emp.name = "sam" " --------------- | salary | --------------- | 300 | --------------- Go * Query sent to backend is "replace emp (salary = 700) where emp.name = "sam" " REPLACE Go * Query sent to backend is "retrieve (e.salary, e.tmin, e.tmax) from e in emp[ , ] where e.name = "sam" " ------------------------------------------- | salary | tmin | tmax | ------------------------------------------- | 300 | Fri Jan 8 16:28:48 1993 PST| Fri Jan 8 16:29:00 1993 PST| ------------------------------------------- | 700 | Fri Jan 8 16:29:00 1993 PST| epoch | ------------------------------------------- Go * Query sent to backend is "retrieve (e.name) from e in emp, s in student where e.age < s.age and s.name = "fred" " --------------- | name | --------------- | bill | --------------- | sharon | --------------- Go * Query sent to backend is "retrieve (e.name) from e in emp*, s in student* where e.age < s.age and s.name = "fred" " --------------- | name | --------------- | bill | --------------- | sharon | --------------- | jeff | --------------- | linda | --------------- Go * Query sent to backend is "retrieve (emp.all) where emp.name = "sharon" or emp.name = "bill" or emp.name = "sam" " ----------------------------------------------------------------------- | location | age | name | salary | manager | ----------------------------------------------------------------------- | (11,10) | 20 | bill | 1000 | sharon | ----------------------------------------------------------------------- | (15,12) | 25 | sharon | 500 | sam | ----------------------------------------------------------------------- | (10,5) | 30 | sam | 700 | bill | ----------------------------------------------------------------------- Go * Query sent to backend is "define rule example_1 is on replace to emp.salary where current.name = "sharon" do replace emp (salary = new.salary) where emp.name = "bill" " DEFINE Go * Query sent to backend is "define rule example_2 is on replace to emp.salary where current.name = "bill" do replace emp (salary = 2 * new.salary) where emp.name = "sam" " DEFINE Go * Query sent to backend is "replace emp (salary=1000) where emp.name = "sharon" " REPLACE Go * Query sent to backend is "retrieve (emp.all) where emp.name = "sharon" or emp.name = "bill" or emp.name = "sam" " ----------------------------------------------------------------------- | location | age | name | salary | manager | ----------------------------------------------------------------------- | (10,5) | 30 | sam | 2000 | bill | ----------------------------------------------------------------------- | (11,10) | 20 | bill | 1000 | sharon | ----------------------------------------------------------------------- | (15,12) | 25 | sharon | 1000 | sam | ----------------------------------------------------------------------- Go * Query sent to backend is "remove rule example_1 " REMOVE Go * Query sent to backend is "remove rule example_2 " REMOVE Go * Query sent to backend is "define rule example_1 is on retrieve to emp.salary where current.name = "sam" do instead retrieve (salary = 2 * emp.salary) where emp.name = "bill" " DEFINE Go * Query sent to backend is "define rule example_2 is on retrieve to emp.salary where current.name = "bill" do instead retrieve (salary = 3 * emp.salary) where emp.name = "sharon" " DEFINE Go * Query sent to backend is "retrieve (emp.all) where emp.name = "sharon" or emp.name = "bill" or emp.name = "sam" " ----------------------------------------------------------------------- | location | age | name | salary | manager | ----------------------------------------------------------------------- | (15,12) | 25 | sharon | 1000 | sam | ----------------------------------------------------------------------- | (10,5) | 30 | sam | 6000 | bill | ----------------------------------------------------------------------- | (11,10) | 20 | bill | 3000 | sharon | ----------------------------------------------------------------------- Go * Query sent to backend is "retrieve (avgsal = int4ave{ emp.salary where emp.salary > 2000 } ) " --------------- | avgsal | --------------- | 4500 | --------------- Go * Query sent to backend is "retrieve (avgsal = int4ave{ emp.salary } ) " --------------- | avgsal | --------------- | 3333 | --------------- Go * Query sent to backend is "define aggregate bletch (sfunc1 = int4mul, sfunc2 = int4inc, finalfunc = int4div, initcond1 = "1", initcond2 = "0") " DEFINE Go * Query sent to backend is "retrieve (randomnum = bletch{emp.salary where emp.salary <= 3000}) " --------------- | randomnum | --------------- | 1500000 | --------------- Go * Query sent to backend is "remove aggregate bletch " REMOVE Go * I live to serve you. =============== destroying demo database... =================