문제

I am creating a TABLE with the following sql:

-- Table: buildings

-- DROP TABLE buildings;

CREATE TABLE buildings
(

osm_id integer NOT NULL,

"name" character varying(255),

"type" character varying(255),

"geometry" geometry,

CONSTRAINT enforce_dims_geometry CHECK (st_ndims(geometry) = 2)

)

WITH (

OIDS=FALSE

);

ALTER TABLE buildings OWNER TO "user";

And Afterwards, trying to fill the table with data from another table with this:

    SELECT osm_id, way

INTO buildings

FROM planet_osm_polygon

WHERE building='yes'

And I get the following error:

ERROR: relation "buildings" already exists

*** Error ***

ERROR: relation "buildings" already exists SQL state: 42P07

Any idea as to why this might be the case? I'm new to pgrouting and trying to figure out how to proceed.

Thanks!

도움이 되었습니까?

해결책

Your command

SELECT osm_id, way

INTO buildings

FROM planet_osm_polygon

WHERE building='yes'

is creating table buildings which has been already created, that's why your getting this error. Please refer this link for more information

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top