Cross database query using dblink
问题 I'd like to use dblink in postgres to copy data from a local database to a remote one. This what I came up with: SELECT * FROM dblink('archive', 'INSERT INTO data SELECT * FROM local.data') It wont work and I think I understand why. I get the error relation "local.data" does not exist , If possible, Id like to run this inside a stored procedure on the local database, in other words I want to push the data to the 'archive' server, rather than pull it to the 'archive'. How can I tell postgres