I'm learning PostgreSQL and PostGIS through "PostGIS in Action" book. My problem comes from Pg. 66 in Listing 3.4.
My code is as follows:
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;
I received this error after running the code:
ERROR: child table "paris_polygons" has different type for column "geom"
SQL state: 42804
I Googled this to find this:
-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)
What would psql command(s) would help me to know how to and merge these?
Thanks again for all the help!