0
我希望這是一個常見的問題。我有兩個不同的計算機:如何從遠程服務器到本地PostgreSQL數據庫中導入特定列的數據?
- 我開發的計算機,
- 正在運行的遠程服務器計算機
每臺計算機都有它自己的運行PostgreSQL數據庫。這兩臺計算機在開發計算機中具有基本相同的表名和幾張表;但開發機器中的表格定義和關係已更改,以更好地處理引用完整性並符合3NF標準。
我需要從遠程服務器的特定數據(即,列)導入到在開發計算機的特定的表(其中發展的表具有不同的結構,則遠程服務器)。
這是如何在PostgreSQL中做了什麼? (我想只是從pgdump加載表會覆蓋較新的開發表結構??)。
東西一起使用PostgreSQL 9.3(僞)
的線路:
insert into <local computer> charges (tposted, patient_recid, fileoninsurance)
select tposted, patient_recid, fileoninsurance
from <Remote Server> (select e.tposted, e.patient_recid, d.fileoninsurance
from encountertimes e
join daysheets d on (e.tposted = d.tposted and e.patient_recid =d.patient_recid).
只是要清楚,表連接需要與遠程服務器表,而不是開發機來完成。
TIA