point
平面上的几何点
当前查看 PostgreSQL 18。
中文定义与说明
平面上的几何点
同版本中文手册定义
point | 16 字节 | 平面上的点 | (x,y) |
PG10–20 核心源码清单。类型转换与操作符类列出源码显式声明的关系;缺少记录不能排除通过其他机制进行转换或使用索引。
定义
平面上的几何点
point
- 目录名称
- pg_catalog.point
- 类型 OID
- 600
- 类型种类
- 基础类型
- 声明长度
- 16 字节
- 存储策略
- plain
- 输入函数
- point_in
- 输出函数
- point_out
- 手册中的声明
- point
- 存储大小
- 16 字节
- 手册说明
- 平面上的点
- 表示方式
- (x,y)
系统目录属性
此构建的源码初始化值。字段含义参见 pg_type 。包含头文件默认值;依赖构建的常量保留符号形式,不作为服务器运行时实测。
oid600descrgeometric point, format '(x,y)'typacl_null_typlen16typelemfloat8typnamepointtypsendpoint_sendtyptypebtypaligndtyparray0typbyvalftypdelim','typinputpoint_intypmodin-typndims0typownerPOSTGREStyprelid0typmodout-typoutputpoint_outtyptypmod-1typanalyze-typdefault_null_typnotnullftypreceivepoint_recvtypstorageptypbasetype0typcategoryGtypcollation0typisdefinedttypnamespacepg_catalogtypsubscriptraw_array_subscript_handlertypdefaultbin_null_array_type_oid1017typispreferredfarray_type_name_point
类型转换 5
与此类型相关的显式 pg_cast 记录。PostgreSQL 还支持 pg_cast 之外的类型转换,缺少记录不能证明转换不可能。
运算符重载 52
每种操作数签名均为独立重载。实现函数和返回类型来自同一源码构建。
| 运算符 | 左操作数 | 右操作数 | 返回类型 | 含义 | 实现函数 |
|---|---|---|---|---|---|
>^ | point | point | bool | 已弃用,请改用 |>>。 | point_above |
<< | point | point | bool | 位于左侧。 | point_left |
>> | point | point | bool | 位于右侧。 | point_right |
<^ | point | point | bool | 已弃用,请改用 <<|。 | point_below |
~= | point | point | bool | 相同。 | point_eq |
<@ | point | box | bool | 点位于矩形内。 | on_pb |
@> | box | point | bool | 包含。 | box_contain_pt |
<@ | point | path | bool | 点位于闭合路径内部或开放路径上。 | on_ppath |
<-> | point | point | float8 | 两者之间的距离。 | point_distance |
<-> | point | line | float8 | 两者之间的距离。 | dist_pl |
<-> | line | point | float8 | 两者之间的距离。 | dist_lp |
<-> | point | lseg | float8 | 两者之间的距离。 | dist_ps |
<-> | lseg | point | float8 | 两者之间的距离。 | dist_sp |
<-> | point | box | float8 | 两者之间的距离。 | dist_pb |
<-> | box | point | float8 | 两者之间的距离。 | dist_bp |
<-> | point | path | float8 | 两者之间的距离。 | dist_ppath |
<-> | path | point | float8 | 两者之间的距离。 | dist_pathp |
<> | point | point | bool | 不等于。 | point_ne |
+ | point | point | point | 点相加(平移)。 | point_add |
- | point | point | point | 点相减(平移)。 | point_sub |
* | point | point | point | 点相乘(缩放或旋转)。 | point_mul |
/ | point | point | point | 点相除(缩放或旋转)。 | point_div |
+ | path | point | path | 相加(平移路径)。 | path_add_pt |
- | path | point | path | 相减(平移路径)。 | path_sub_pt |
* | path | point | path | 相乘(旋转或缩放路径)。 | path_mul_pt |
/ | path | point | path | 相除(旋转或缩放路径)。 | path_div_pt |
@> | path | point | bool | 包含。 | path_contain_pt |
<@ | point | polygon | bool | 被包含。 | pt_contained_poly |
@> | polygon | point | bool | 包含。 | poly_contain_pt |
<@ | point | circle | bool | 被包含。 | pt_contained_circle |
@> | circle | point | bool | 包含。 | circle_contain_pt |
+ | box | point | box | 矩形加上点(平移)。 | box_add |
- | box | point | box | 矩形减去点(平移)。 | box_sub |
* | box | point | box | 矩形与点相乘(缩放)。 | box_mul |
/ | box | point | box | 矩形除以点(缩放)。 | box_div |
?- | point | point | bool | 水平对齐。 | point_horiz |
?| | point | point | bool | 竖直对齐。 | point_vert |
+ | circle | point | circle | 相加。 | circle_add_pt |
- | circle | point | circle | 相减。 | circle_sub_pt |
* | circle | point | circle | 相乘。 | circle_mul_pt |
/ | circle | point | circle | 相除。 | circle_div_pt |
<-> | point | circle | float8 | 两者之间的距离。 | dist_pc |
<-> | circle | point | float8 | 两者之间的距离。 | dist_cpoint |
<-> | point | polygon | float8 | 两者之间的距离。 | dist_ppoly |
<-> | polygon | point | float8 | 两者之间的距离。 | dist_polyp |
<@ | point | line | bool | 点位于直线上。 | on_pl |
<@ | point | lseg | bool | 被包含。 | on_ps |
## | point | line | point | B 上距离 A 最近的点。 | close_pl |
## | point | lseg | point | B 上距离 A 最近的点。 | close_ps |
## | point | box | point | B 上距离 A 最近的点。 | close_pb |
|>> | point | point | bool | 位于上方。 | point_above |
<<| | point | point | bool | 位于下方。 | point_below |
操作符类 3
声明输入类型与此类型相符的操作符类。多态操作符类、类型转换和表达式索引还可能提供其他索引路径;不能仅凭此表判断是否支持索引。
| 操作符类 | 索引方法 | 输入类型 | 操作符族 | 默认 | 存储类型 |
|---|---|---|---|---|---|
point_ops | gist | point | gist/point_ops | 是 | box |
quad_point_ops | spgist | point | spgist/quad_point_ops | 是 | 与输入类型相同 |
kd_point_ops | spgist | point | spgist/kd_point_ops | 否 | 与输入类型相同 |
版本比较
PostgreSQL 17 → 18。属性比较不包含构建标识和说明正文;原始目录字段与源描述保留原文。
这两个样本的系统目录和结构化属性没有变化。
文档与源码
- 构建
- 18.6 · https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2
- 指纹
555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f
相关条目
全部数据类型 · 下载此版本 JSON · 最早收录的样本不代表该类型的实际引入版本。