datax配置pg writeMode 參數只有 "insert","update"
update異常
ON CONFLICT DO UPDATE requires inference specification or constraint name 2023-09-28 09:02:46 [ExecutorJobHandler.reader-133] Hint: For example, ON CONFLICT (column_name).
解決:
update語句找不到主鍵 , "writeMode": "update(id)"
update模式 手動配置主鍵,如果多個主鍵使用"," 分割.
demo
{
"core": {
"transport": {
"channel": {
"speed": {
"byte": 5242880
}
}
}
},
"job": {
"setting": {
"speed": {
"channel": 5
},
"errorLimit": {
"record": 0,
"percentage": 0.02
}
},
"content": [
{
"reader": {
"name": "postgresqlreader",
"parameter": {
"username": "***",
"password": "***",
"column": [
"id",
"entity_uid",
"serial_number"
],
"splitPk": "",
"connection": [
{
"table": [
"tool_archives"
],
"jdbcUrl": [
"jdbc:postgresql://***"
]
}
]
}
},
"writer": {
"name": "postgresqlwriter",
"parameter": {
"writeMode": "update(id)",
"username": "***",
"password": "***",
"column": [
"id",
"entity_uid",
"entityversion",
"serial_number"
],
"preSql": [
""
],
"connection": [
{
"table": [
"tool_archives"
],
"jdbcUrl": "***"
}
]
}
}
}
]
}
}