数据从PostgreSQL导入到PostgreSQL的DataX模板
{
"job": {
"setting": {
"speed": {
"channel": 1
}
},
"content": [
{
"reader": {
"name": "postgresqlreader",
"parameter": {
"username": "your_username",
"password": "your_password",
"column": ["id", "name"],
"splitPk": "id",
"connection": [
{
"querySql": [
"select id, name from your_source_table where ..."
],
"jdbcUrl": [
"jdbc:postgresql://your_source_ip:your_source_port/your_source_db"
]
}
]
}
},
"writer": {
"name": "postgresqlwriter",
"parameter": {
"username": "your_username",
"password": "your_password",
"column": ["id", "name"],
"connection": [
{
"jdbcUrl": "jdbc:postgresql://your_target_ip:your_target_port/your_target_db",
"table": ["your_target_table"]
}
]
}
}
}
]
}
}
这个JSON模板定义了一个DataX作业,它从一个PostgreSQL数据库表中读取数据,并将数据写入到同一类型的另一个PostgreSQL数据库表中。模板中包含了必要的配置项,如用户名和密码,需要根据实际情况替换为正确的值。同时,querySql和jdbcUrl应该根据实际需要导出的数据和目标数据库的信息进行相应的修改。
评论已关闭