Skip to content Skip to sidebar Skip to footer

Python Postgres Best Way To Insert Data From Table On One Db To Another Table On Another Db

I have the following python code that copies content of a table on postgres DB1 and INSERTS into a similar table on postgres DB2. I want to speed it up by using BULK INSERTS. How d

Solution 1:

Simpliest way is to use FDW (foreign data wrappers) for connect both servers (https://www.postgresql.org/docs/9.5/static/postgres-fdw.html). And operate by both table in one server.

Second way is use dblink (https://www.postgresql.org/docs/9.6/static/dblink.html).

By both this way data directly pass from one server to second (no via your program)

Post a Comment for "Python Postgres Best Way To Insert Data From Table On One Db To Another Table On Another Db"