「PostGIS in Action」という本で PostgreSQL と PostGIS を学んでいます。私の問題はPgから来ています。リスト 3.4 の 66。
私のコードは次のとおりです。
CREATE TABLE ch03.paris_polygons(tags hstore, CONSTRAINT paris_polygons_pk PRIMARY KEY (gid)
)
INHERITS (ch03.paris);
ALTER TABLE ch03.paris_polygons NO INHERIT ch03.paris;
INSERT INTO ch03.paris_polygons(osm_id, ar_num, geom, tags, feature_name, feature_type)
SELECT osm_id, ar_num, ST_Multi(geom) As geom, tags, tags->'name',
COALESCE(tags->'tourism', tags->'railway','other')::varchar(50) As feature_type
FROM ch03.paris_hetero
WHERE ST_GeometryType(geom) LIKE '%Polygon';
SELECT populate_geometry_columns('ch03.paris_polygons'::regclass);
ALTER TABLE ch03.paris_polygons INHERIT ch03.paris;
コードを実行した後、次のエラーを受け取りました。
ERROR: child table "paris_polygons" has different type for column "geom"
SQL state: 42804
これを見つけるためにこれをグーグルで検索しました:
-204 (ECPG_INT_FORMAT)
The host variable is of type int and the datum in the database is of a different type and contains a value that cannot be interpreted as an int. The library uses strtol() for this conversion. (SQLSTATE 42804)
これらをマージする方法を知り、マージするのに役立つpsqlコマンドは何ですか?
すべての助けをありがとう!