i’m using docker to host two different postgresql instances to try and produce a proof of concept for python as an etl to move data between the two i can connect to the one via python fine but then when calling a procedure inside the first instance it cant find the table in the second instance im connecting to the second instance using dblink using this code
FROM dblink('host=localhost port=5432 user=postgres password=postgres dbname=postgres','SELECT * FROM staging.test')
the error message from this is that the relation staging.test does not exist
Advertisement
Answer
When using multiple docker images with postgresql installed on each to get these images to talk to each other when on local host in the connection string use the service name instead of local host
FROM dblink('host=ServiceName port=5432 user=postgres password=postgres dbname=postgres', 'SELECT * FROM staging.test')