您的位置:首页 > 数据库

PostgreSQL学习篇9.11 几何类型

2016-12-24 11:31 351 查看
集合类型挺复杂,各种操作符各种函数。

point :平面中的点
line:直线
lseg:线段
box:矩形
path:路径,()表示闭合路径,[]表示开放路径
circle:圆
等

输入:
类型名称 '表现形式'
'表现形式'::类型名称

postgres=# select '1,1'::point;
point
-------
(1,1)
(1 row)

postgres=# select '(1,1)'::point;
point
-------
(1,1)
(1 row)

postgres=# select lseg'1,1,2,3';
lseg
---------------
[(1,1),(2,3)]
(1 row)

postgres=# select box'1,2,1,4';
box
-------------
(1,4),(1,2)
(1 row)

postgres=# select path'1,3,6,8,9,3,4,7';
path
---------------------------
((1,3),(6,8),(9,3),(4,7))
(1 row)
postgres=# select circle'1,2,3';
circle
-----------
<(1,2),3>
(1 row)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: