I am inserting rows into my database. I have a field with a DECIMAL type and a constraint:
retail_price_per_unit DECIMAL(10,2) NOT NULL
CONSTRAINT positive_retail_price CHECK (retail_price_per_unit >= 0),
However, when I insert a row where the retail_price_per_unit = 0 I get the following error:
{
"errorMessage": "Invalid input for 'retail_price_per_unit' [item 3]",
"errorDescription": "The value \"retail_price_per_unit\" is required but not set",
"errorDetails": {},
"n8nDetails": {
"itemIndex": 3,
"runIndex": 0,
"time": "11/27/2024, 5:23:27 PM",
"n8nVersion": "1.68.0 (Self Hosted)",
"binaryDataMode": "default",
"stackTrace": [
"ExpressionError: Invalid input for 'retail_price_per_unit' [item 3]",
" at validateValueAgainstSchema (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1559:15)",
" at getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1681:57)",
" at Object.getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:2327:24)",
" at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Postgres/v2/actions/database/insert.operation.js:172:29)",
" at processTicksAndRejections (node:internal/process/task_queues:95:5)",
" at Object.router (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Postgres/v2/actions/router.js:50:30)",
" at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Postgres/v2/PostgresV2.node.js:16:16)",
" at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:722:19)",
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:704:51",
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1134:20"
]
}
}
My value for item 3:
To Reproduce
Create table:
CREATE TABLE dummy_table (
id TEXT PRIMARY KEY,
retail_price_per_unit DECIMAL(10,2) NOT NULL
CONSTRAINT positive_retail_price CHECK (retail_price_per_unit >= 0)
);
Create postgres node and attempt to write 0 to retail_price_per_unit.
Bug Description
I am inserting rows into my database. I have a field with a DECIMAL type and a constraint:
However, when I insert a row where the retail_price_per_unit = 0 I get the following error:
My value for item 3:
To Reproduce
Create table:
Create postgres node and attempt to write 0 to retail_price_per_unit.
Expected behavior
0 is a valid input
Operating System
Ubuntu 22.04
n8n Version
1.68.0
Node.js Version
20
Database
PostgreSQL
Execution mode
main (default)