如何从 postgis 中找到点几何类型表?
How can I find point geometry typed tables from postgis?
我想从 postgis 获取所有点几何类型 tables。我可以使用 sql select 进行此操作吗?
我可以 select 来自 select * from information_schema.tables
table 的所有 table。
我可以像这样获取所有几何列:
SELECT type FROM geometry_columns;
本次查询returns"GEOMETRY"
但我想 select 所有 table 具有 POINT 几何类型的 hh。
如果我答对了你的问题,你可以从 information_schema
查询它:
select distinct table_schema, table_name
from information_schema.columns
where data_type = 'point';
例如:
t=# create table p(i point);
CREATE TABLE
t=# select distinct table_schema,table_name from information_schema.columns where data_type = 'point';
table_schema | table_name
--------------+------------
postgres | p
(1 row)
我想从 postgis 获取所有点几何类型 tables。我可以使用 sql select 进行此操作吗?
我可以 select 来自 select * from information_schema.tables
table 的所有 table。
我可以像这样获取所有几何列:
SELECT type FROM geometry_columns;
本次查询returns"GEOMETRY"
但我想 select 所有 table 具有 POINT 几何类型的 hh。
如果我答对了你的问题,你可以从 information_schema
查询它:
select distinct table_schema, table_name
from information_schema.columns
where data_type = 'point';
例如:
t=# create table p(i point);
CREATE TABLE
t=# select distinct table_schema,table_name from information_schema.columns where data_type = 'point';
table_schema | table_name
--------------+------------
postgres | p
(1 row)