首页 文章

如何从postgis中找到点几何类型表?

提问于
浏览
0

我想从postgis获取所有点几何类型表 . 我可以使用sql select进行此操作 .

我可以从 select * from information_schema.tables 表中选择所有表格 .

我可以得到像这样的所有几何列:

SELECT type FROM geometry_columns;

此查询返回“GEOMETRY”

但我想选择所有具有POINT几何类型的表 .

1 回答

  • 0

    如果我的问题正确,你可以从 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)
    

相关问题