pg_upsert
Insert or update rows in a PostgreSQL table, handling conflicts on specified columns. Requires explicit confirmation for execution.
Instructions
Insert or update on conflict. Requires confirm=true.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"target": "<target>",
"table": "<table>",
"columns": "<columns>",
"values": "<values>",
"conflict_columns": "<conflict_columns>",
"confirm": "<confirm>"
},
"name": "pg_upsert"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table name | |
| schema | No | Schema name (default: 'public') | |
| target | Yes | Target name from ~/.dbx/targets/ | |
| values | Yes | JSON array of values to insert | |
| columns | Yes | JSON array of column names | |
| confirm | Yes | Must be 'true' to execute this destructive operation | |
| conflict_columns | Yes | JSON array of columns for ON CONFLICT clause |