docker run --rm -e PGHOST=localhost -e PGPASSWORD=xxxxxx -e PGDATABASE=osm soxueren/osm-website:pg
导入数据前需要处理的问题
current_way_nodes 外键导致导入出错问题
-- nearby字段新版缺失问题
-- Add column nearby to the users table
ALTER TABLE public.users
ADD COLUMN nearby integer DEFAULT 50;
-- 解决current_way_nodes表的数据不一致bug
-- Drop current_way_nodes_node_id_fkey
ALTER TABLE public.current_way_nodes
DROP CONSTRAINT current_way_nodes_node_id_fkey
ALTER TABLE public.changesets
DROP CONSTRAINT changesets_user_id_fkey;
-- osmosis导入数据出现user_id=-1的问题
UPDATE changesets set user_id=1 where user_id=-1;
UPDATE users set id=1 where id=-1;
ALTER TABLE public.changesets
ADD CONSTRAINT changesets_user_id_fkey FOREIGN KEY (user_id)
REFERENCES public.users (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION;
I built the osm-website:pg image depend on your quickstart.md. I think it's ok (no error)
I ran postgis command before, and then I ran init db command.
But I got:
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
Couldn't create 'osm' database. Please check your configuration.
rake aborted!
PG::ConnectionBad: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
I tried "telnet localhost 5432", it was connected.
So what I missed? Please help me to run your configuaration
Thanks,
init db command: docker run --rm -e PG_HOST=localhost -e POSTGRES_USER=postgres -e PGPASSWORD=123456 -e PGDATABASE=osm osm-website:pg