4 CREATE TABLE CIRCLE_TBL (f1 circle);
5 INSERT INTO CIRCLE_TBL VALUES ('<(5,1),3>');
6 INSERT INTO CIRCLE_TBL VALUES ('<(1,2),100>');
7 INSERT INTO CIRCLE_TBL VALUES ('1,3,5');
8 INSERT INTO CIRCLE_TBL VALUES ('((1,2),3)');
9 INSERT INTO CIRCLE_TBL VALUES ('<(100,200),10>');
10 INSERT INTO CIRCLE_TBL VALUES ('<(100,1),115>');
12 INSERT INTO CIRCLE_TBL VALUES ('<(-100,0),-100>');
13 ERROR: invalid input syntax for type circle: "<(-100,0),-100>"
14 LINE 1: INSERT INTO CIRCLE_TBL VALUES ('<(-100,0),-100>');
16 INSERT INTO CIRCLE_TBL VALUES ('1abc,3,5');
17 ERROR: invalid input syntax for type circle: "1abc,3,5"
18 LINE 1: INSERT INTO CIRCLE_TBL VALUES ('1abc,3,5');
20 INSERT INTO CIRCLE_TBL VALUES ('(3,(1,2),3)');
21 ERROR: invalid input syntax for type circle: "(3,(1,2),3)"
22 LINE 1: INSERT INTO CIRCLE_TBL VALUES ('(3,(1,2),3)');
24 SELECT * FROM CIRCLE_TBL;
35 SELECT '' AS six, center(f1) AS center
47 SELECT '' AS six, radius(f1) AS radius
59 SELECT '' AS six, diameter(f1) AS diameter
71 SELECT '' AS two, f1 FROM CIRCLE_TBL WHERE radius(f1) < 5;
78 SELECT '' AS four, f1 FROM CIRCLE_TBL WHERE diameter(f1) >= 10;
80 ------+----------------
87 SELECT '' as five, c1.f1 AS one, c2.f1 AS two, (c1.f1 <-> c2.f1) AS distance
88 FROM CIRCLE_TBL c1, CIRCLE_TBL c2
89 WHERE (c1.f1 < c2.f1) AND ((c1.f1 <-> c2.f1) > 0)
90 ORDER BY distance, area(c1.f1), area(c2.f1);
91 five | one | two | distance
92 ------+----------------+----------------+------------------
93 | <(100,200),10> | <(100,1),115> | 74
94 | <(100,200),10> | <(1,2),100> | 111.370729772479
95 | <(1,3),5> | <(100,200),10> | 205.476756144497
96 | <(5,1),3> | <(100,200),10> | 207.51303816328
97 | <(1,2),3> | <(100,200),10> | 208.370729772479