# Postgres - Error when select rows comparing timestamp field

**URL:** <https://community.n8n.io/t/postgres-error-when-select-rows-comparing-timestamp-field/227890>\
**Category:** Questions\
**Tags:** postgres\
**Created:** [November 28, 2025, 10:25am UTC](https://community.n8n.io/t/postgres-error-when-select-rows-comparing-timestamp-field/227890 "2025-11-28T10:25:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PabloRQ](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/pablorq/32/30343_2.png) [@PabloRQ](https://community.n8n.io/u/PabloRQ)\
**Post date:** [November 28, 2025, 10:25am UTC](https://community.n8n.io/t/postgres-error-when-select-rows-comparing-timestamp-field/227890/1 "2025-11-28T10:25:21Z")

</div>

## Describe the problem/error/question

I’m trying to get the newest records from a Postgres table, getting only the ones greater or equal to a specific date.

Using the Postgres Node with Operation=Select, the node gives an error.

Using the Postgres Node with Operation=Execute Query, the node works ok. In this case, the query is:

```auto
SELECT * FROM urls WHERE added >= $1

```

In both cases, the comparing date is:

```auto
{{ new Date(Date.now() - 10 * 24 * 60 * 60 * 1000).toISOString() }}

```

This seems to be the similar problem that the question [Postgres node and postgres trigger node](http://community.n8n.io/t/postgres-node-and-postgres-trigger-node/27564) from 2023, but it seems to be not resolved.

## What is the error message (if any)?

Operator in entry 1 of ‘Select Rows’ works with numbers, but value 2025-11-18T10:08:40.673Z is not a number [item 0]

## Please share your workflow

{  
“nodes”: [  
{  
“parameters”: {},  
“type”: “n8n-nodes-base.noOp”,  
“typeVersion”: 1,  
“position”: [  
-16,  
240  
],  
“id”: “fbd1d55e-896a-47f0-8b4e-12c3e939f336”,  
“name”: “after\_loop”  
},  
{  
“parameters”: {  
“operation”: “select”,  
“schema”: {  
“\_\_rl”: true,  
“value”: “public”,  
“mode”: “list”,  
“cachedResultName”: “public”  
},  
“table”: {  
“\_\_rl”: true,  
“value”: “urls”,  
“mode”: “list”,  
“cachedResultName”: “urls”  
},  
“where”: {  
“values”: [  
{  
“column”: “added”,  
“condition”: “\>=”,  
“value”: “={{ new Date(Date.now() - 10 \* 24 \* 60 \* 60 \* 1000).toISOString() }}”  
}  
]  
},  
“options”: {}  
},  
“type”: “n8n-nodes-base.postgres”,  
“typeVersion”: 2.6,  
“position”: [  
224,  
144  
],  
“id”: “ec1a98ff-1384-443e-91ce-1ae0d73ef1df”,  
“name”: “Select rows from a table”,  
“alwaysOutputData”: true,  
“credentials”: {  
“postgres”: {  
“id”: “ibj2411N8FoIh62h”,  
“name”: “OCI-Postgres”  
}  
}  
},  
{  
“parameters”: {  
“operation”: “executeQuery”,  
“query”: “SELECT \* FROM urls WHERE added \>= $1”,  
“options”: {  
“queryReplacement”: “={{ new Date(Date.now() - 10 \* 24 \* 60 \* 60 \* 1000).toISOString() }}”  
}  
},  
“type”: “n8n-nodes-base.postgres”,  
“typeVersion”: 2.6,  
“position”: [  
224,  
336  
],  
“id”: “3f847627-4cf5-49b9-a0fa-4a78529139b6”,  
“name”: “Execute a SQL query”,  
“executeOnce”: true,  
“credentials”: {  
“postgres”: {  
“id”: “ibj2411N8FoIh62h”,  
“name”: “OCI-Postgres”  
}  
}  
}  
],  
“connections”: {  
“after\_loop”: {  
“main”: [  
[  
{  
“node”: “Execute a SQL query”,  
“type”: “main”,  
“index”: 0  
},  
{  
“node”: “Select rows from a table”,  
“type”: “main”,  
“index”: 0  
}  
]  
]  
},  
“Select rows from a table”: {  
“main”: [  
  
]  
}  
},  
“pinData”: {},  
“meta”: {  
“templateCredsSetupCompleted”: true,  
“instanceId”: “f9acd581ca6add88de8c62a6233e7ca5dd61188c9979395ef8f5a22ec755c644”  
}  
}

## Share the output returned by the last node

{  
“errorMessage”: “Operator in entry 1 of ‘Select Rows’ works with numbers, but value 2025-11-18T10:08:40.673Z is not a number [item 0]”,  
“errorDetails”: {},  
“n8nDetails”: {  
“nodeName”: “Select rows from a table”,  
“nodeType”: “n8n-nodes-base.postgres”,  
“nodeVersion”: 2.6,  
“resource”: “database”,  
“operation”: “select”,  
“itemIndex”: 0,  
“time”: “11/28/2025, 11:08:40 AM”,  
“n8nVersion”: “1.120.4 (Self Hosted)”,  
“binaryDataMode”: “default”,  
“stackTrace”: [  
“NodeOperationError: Operator in entry 1 of ‘Select Rows’ works with numbers, but value 2025-11-18T10:08:40.673Z is not a number”,  
" at /usr/local/lib/node\_modules/n8n/node\_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base\_@aws-sdk+credential-providers@3.808.0\_asn1.js@5\_afd197edb2c1f848eae21a96a97fab23/node\_modules/n8n-nodes-base/nodes/Postgres/v2/helpers/utils.ts:160:11",  
" at Array.forEach ()“,  
" at addWhereClauses (/usr/local/lib/node\_modules/n8n/node\_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base\_@aws-sdk+credential-providers@3.808.0\_asn1.js@5\_afd197edb2c1f848eae21a96a97fab23/node\_modules/n8n-nodes-base/nodes/Postgres/v2/helpers/utils.ts:152:10)”,  
" at ExecuteContext.execute (/usr/local/lib/node\_modules/n8n/node\_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base\_@aws-sdk+credential-providers@3.808.0\_asn1.js@5\_afd197edb2c1f848eae21a96a97fab23/node\_modules/n8n-nodes-base/nodes/Postgres/v2/actions/database/select.operation.ts:112:36)“,  
" at ExecuteContext.router (/usr/local/lib/node\_modules/n8n/node\_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base\_@aws-sdk+credential-providers@3.808.0\_asn1.js@5\_afd197edb2c1f848eae21a96a97fab23/node\_modules/n8n-nodes-base/nodes/Postgres/v2/actions/router.ts:41:68)”,  
" at processTicksAndRejections (node:internal/process/task\_queues:105:5)“,  
" at ExecuteContext.execute (/usr/local/lib/node\_modules/n8n/node\_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base\_@aws-sdk+credential-providers@3.808.0\_asn1.js@5\_afd197edb2c1f848eae21a96a97fab23/node\_modules/n8n-nodes-base/nodes/Postgres/v2/PostgresV2.node.ts:26:10)”,  
" at WorkflowExecute.executeNode (/usr/local/lib/node\_modules/n8n/node\_modules/.pnpm/n8n-core@file+packages+core\_@opentelemetry+api@1.9.0\_@opentelemetry+sdk-trace-base@1.30\_08b575bec2313d5d8a4cc75358971443/node\_modules/n8n-core/src/execution-engine/workflow-execute.ts:1093:8)“,  
" at WorkflowExecute.runNode (/usr/local/lib/node\_modules/n8n/node\_modules/.pnpm/n8n-core@file+packages+core\_@opentelemetry+api@1.9.0\_@opentelemetry+sdk-trace-base@1.30\_08b575bec2313d5d8a4cc75358971443/node\_modules/n8n-core/src/execution-engine/workflow-execute.ts:1274:11)”,  
" at /usr/local/lib/node\_modules/n8n/node\_modules/.pnpm/n8n-core@file+packages+core\_@opentelemetry+api@1.9.0\_@opentelemetry+sdk-trace-base@1.30\_08b575bec2313d5d8a4cc75358971443/node\_modules/n8n-core/src/execution-engine/workflow-execute.ts:1708:27"  
]  
}  
}

## Information on your n8n setup

- **n8n version: 1.120.4**
- **Database (default: SQLite): Postgres SQL 17**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app): docker**
- **Operating system:**

---

<div class="post-metadata">

**Author:** ![Parintele\_Damaskin](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/parintele_damaskin/32/139243_2.png) [@Parintele\_Damaskin](https://community.n8n.io/u/Parintele_Damaskin)\
**Post date:** [November 29, 2025, 12:49pm UTC](https://community.n8n.io/t/postgres-error-when-select-rows-comparing-timestamp-field/227890/2 "2025-11-29T12:49:33Z")

</div>

> [@PabloRQ](#):
>
> Using the Postgres Node with Operation=Execute Query, the node works ok

Yes, this option is more flexible, since you can do some selections based of a SQL query :

WHERE added \>= NOW() - INTERVAL ‘1 day’

or complex query with DESC, LIMIT .

Cheers!

---

<div class="post-metadata">

**Author:** ![PabloRQ](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/pablorq/32/30343_2.png) [@PabloRQ](https://community.n8n.io/u/PabloRQ)\
**Post date:** [November 29, 2025, 1:06pm UTC](https://community.n8n.io/t/postgres-error-when-select-rows-comparing-timestamp-field/227890/3 "2025-11-29T13:06:38Z")

</div>

Yes, the SQL query is more flexible, but I only want to get all rows where a value in a column is equal to greater than a set value (fixed or expression).

This can be configured in the Postgres node with the Select option, but it doesn’t work.

I’m not looking for an alternative solution. I’m pointing to a bug in the Postgres node to be fixed. And this bug is there from 2023. Maybe is time to fix it.

---

<div class="post-metadata">

**Author:** ![PabloRQ](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/pablorq/32/30343_2.png) [@PabloRQ](https://community.n8n.io/u/PabloRQ)\
**Post date:** [December 27, 2025, 6:19pm UTC](https://community.n8n.io/t/postgres-error-when-select-rows-comparing-timestamp-field/227890/4 "2025-12-27T18:19:50Z")

</div>

Any update about this bug?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [March 28, 2026, 8:25am UTC](https://community.n8n.io/t/postgres-error-when-select-rows-comparing-timestamp-field/227890/6 "2026-03-28T08:25:17Z")

</div>

Closed on March 28, 2026, 8:25am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
