使用shp2pgsql将shapefile导入PostGIS数据库,一切正常:

Connection: host=localhost port=5432 user=aperrin dbname=tweets password='******'
Destination: public.County_2010Census_DP1
Source File: /home/aperrin/Downloads/County_2010Census_DP1/County_2010Census_DP1
Shapefile type: Polygon
Postgis type: MULTIPOLYGON[2]
Importing shapefile (3221 records)...
Creating spatial index...

Shapefile import completed.

在psql中,显示:
                          List of relations
 Schema |                  Name                   |   Type   |  Owner
--------+-----------------------------------------+----------+----------
 public | County_2010Census_DP1                   | table    | aperrin
 public | County_2010Census_DP1_gid_seq           | sequence | aperrin

然而:
tweets=> \d County_2010Census_DP1
Did not find any relation named "County_2010Census_DP1".
tweets=> select * from County_2010Census_DP1;
ERROR:  relation "county_2010census_dp1" does not exist
LINE 1: select * from County_2010Census_DP1;

最佳答案

使用全小写的表名解决了这个问题。用我们县作为表名。

10-06 09:11