polygon.out
上传用户:blenddy
上传日期:2007-01-07
资源大小:6495k
文件大小:4k
源码类别:

数据库系统

开发平台:

Unix_Linux

  1. QUERY: CREATE TABLE POLYGON_TBL(f1 polygon);
  2. QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(2.0,0.0),(2.0,4.0),(0.0,0.0)');
  3. QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(3.0,1.0),(3.0,3.0),(1.0,0.0)');
  4. QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(0.0,0.0)');
  5. QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(0.0,1.0),(0.0,1.0)');
  6. QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('0.0');
  7. ERROR:  Bad polygon external representation '0.0'
  8. QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(0.0 0.0');
  9. ERROR:  Bad polygon external representation '(0.0 0.0'
  10. QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(0,1,2)');
  11. ERROR:  Bad polygon external representation '(0,1,2)'
  12. QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('(0,1,2,3');
  13. ERROR:  Bad polygon external representation '(0,1,2,3'
  14. QUERY: INSERT INTO POLYGON_TBL(f1) VALUES ('asdf');
  15. ERROR:  Bad polygon external representation 'asdf'
  16. QUERY: SELECT '' AS four, POLYGON_TBL.*;
  17. four|f1                 
  18. ----+-------------------
  19.     |((2,0),(2,4),(0,0))
  20.     |((3,1),(3,3),(1,0))
  21.     |((0,0))            
  22.     |((0,1),(0,1))      
  23. (4 rows)
  24. QUERY: SELECT '' AS three, p.*
  25.    FROM POLYGON_TBL p
  26.    WHERE p.f1 && '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
  27. three|f1                 
  28. -----+-------------------
  29.      |((2,0),(2,4),(0,0))
  30.      |((3,1),(3,3),(1,0))
  31. (2 rows)
  32. QUERY: SELECT '' AS four, p.*
  33.    FROM POLYGON_TBL p
  34.    WHERE p.f1 &< '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
  35. four|f1                 
  36. ----+-------------------
  37.     |((2,0),(2,4),(0,0))
  38.     |((3,1),(3,3),(1,0))
  39.     |((0,0))            
  40.     |((0,1),(0,1))      
  41. (4 rows)
  42. QUERY: SELECT '' AS two, p.*
  43.    FROM POLYGON_TBL p
  44.    WHERE p.f1 &> '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
  45. two|f1                 
  46. ---+-------------------
  47.    |((2,0),(2,4),(0,0))
  48.    |((3,1),(3,3),(1,0))
  49. (2 rows)
  50. QUERY: SELECT '' AS one, p.*
  51.    FROM POLYGON_TBL p
  52.    WHERE p.f1 << '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
  53. one|f1           
  54. ---+-------------
  55.    |((0,0))      
  56.    |((0,1),(0,1))
  57. (2 rows)
  58. QUERY: SELECT '' AS zero, p.*
  59.    FROM POLYGON_TBL p
  60.    WHERE p.f1 >> '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
  61. zero|f1
  62. ----+--
  63. (0 rows)
  64. QUERY: SELECT '' AS one, p.*
  65.    FROM POLYGON_TBL p
  66.    WHERE p.f1 @ '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon;
  67. one|f1                 
  68. ---+-------------------
  69.    |((3,1),(3,3),(1,0))
  70. (1 row)
  71. QUERY: SELECT '' AS one, p.*
  72.    FROM POLYGON_TBL p
  73.    WHERE p.f1 ~= '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon;
  74. one|f1                 
  75. ---+-------------------
  76.    |((3,1),(3,3),(1,0))
  77. (1 row)
  78. QUERY: SELECT '' AS one, p.*
  79.    FROM POLYGON_TBL p
  80.    WHERE p.f1 ~ '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon;
  81. one|f1                 
  82. ---+-------------------
  83.    |((3,1),(3,3),(1,0))
  84. (1 row)
  85. QUERY: SELECT '(2.0,0.0),(2.0,4.0),(0.0,0.0)'::polygon << '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon AS false;
  86. false
  87. -----
  88. f    
  89. (1 row)
  90. QUERY: SELECT '(2.0,0.0),(2.0,4.0),(0.0,0.0)'::polygon << '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon AS true;
  91. true
  92. ----
  93. f   
  94. (1 row)
  95. QUERY: SELECT '(2.0,0.0),(2.0,4.0),(0.0,0.0)'::polygon &> '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon AS true;
  96. true
  97. ----
  98. t   
  99. (1 row)
  100. QUERY: SELECT '(2.0,0.0),(2.0,4.0),(0.0,0.0)'::polygon >> '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon AS false;
  101. false
  102. -----
  103. f    
  104. (1 row)
  105. QUERY: SELECT '(2.0,0.0),(2.0,4.0),(0.0,0.0)'::polygon @ '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon AS false;
  106. false
  107. -----
  108. f    
  109. (1 row)
  110. QUERY: SELECT '(2.0,0.0),(2.0,4.0),(0.0,0.0)'::polygon ~ '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon AS false;
  111. false
  112. -----
  113. f    
  114. (1 row)
  115. QUERY: SELECT '(2.0,0.0),(2.0,4.0),(0.0,0.0)'::polygon ~= '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon AS false;
  116. false
  117. -----
  118. f    
  119. (1 row)
  120. QUERY: SELECT '(2.0,0.0),(2.0,4.0),(0.0,0.0)'::polygon && '(3.0,1.0),(3.0,3.0),(1.0,0.0)'::polygon AS true;
  121. true
  122. ----
  123. t   
  124. (1 row)