update_rows
Modify table rows that match a WHERE filter in PostgreSQL, automatically rolling back changes above 100 rows and reporting affected plus returning rows.
Instructions
Updates the rows of one table that match a where filter. Rolls back a call that changes more than 100 rows, triggers and cascades included. Returns rowsAffected and up to 1,000 returning rows.
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": {
"database": "<database>",
"table": "<table>",
"set": "<set>",
"where": "<where>"
},
"name": "update_rows"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| set | Yes | The columns to set and their new values. | |
| table | Yes | The table or view to update, by exact name. | |
| where | Yes | Conditions joined by AND that pick the rows to update. | |
| schema | No | The schema, by exact name. Defaults to public. | |
| database | Yes | The database to run on. | |
| returning | No | Columns to return from each changed row. Omit to return none. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | The result rows, each an array in column order. | |
| columns | Yes | The result columns, in order. | |
| rowsAffected | Yes | The number of rows changed. |