Postgres convert PATH type to ARRAY

喜欢而已 提交于 2021-02-11 06:33:18

问题


Is there any way to convert Postgres PATH type to an ARRAY in order to have index access to it's points?


回答1:


There is no way to do that with PostgreSQL alone - you'd have to write your own C function.

With the PostGIS extension, you can cast the path to geometry and perform the operation there:

SELECT array_agg(CAST(geom AS point))
FROM st_dumppoints(CAST(some_path AS geometry));


来源:https://stackoverflow.com/questions/60389921/postgres-convert-path-type-to-array

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!