Postgresql Insert error parsing ISO format string

I using Postgresql Insert node, but it error when column type is timestamp
I have the input date in ISO 8601 date string format and I keep getting an error.

What is the error message (if any)?

Input of Insert node

Output of Insert node

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Error Message:
parsing as type timestamp: unexpected separator ‘"’ for field Year
Wanted: [ Year Month Day Era Hour Minute Second Nanos Meridian TZHour TZMinute TZSecond ] Already found in input:

I expected to successful insert base this document Postgres node common issues | n8n Docs

Information on your n8n setup

  • n8n version: 1.111.0
  • Database (default: SQLite): Postgresql
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu 20.04

Hey @DragonPow hope all is good.

Took your input data and populated my db with it.

My DB:

Workflow:

Result:

I think maybe wrong with n8n configuration, it fail when parse from input of n8n, not in DB query Insert

it is possible, want to share some of it?

This is my input

Can you copy and paste your workflow here?

here

First thing that jumped out - is you have all the fields on the left and in the table named the same. If this is actually the case in your actual workflow - you could just use automatic mapping. Let me now take alook at the rest.

this problem still occurred with node Postgresql Update, so i want to find problem to fix it instead of using automate mapping

yeah, no issues with your workflow on my side

Maybe try
{{ $json.thoi_gian_bd.toDateTime() }}
{{ $json.thoi_gian_kt.toDateTime() }}

also error with fixed value

CREATE TABLE public.test (
	id serial PRIMARY KEY,
	thoi_gian_bd timestamp without time zone,
	thoi_gian_kt timestamp without time zone
);

Let’s compare things:

SELECT version();

PostgreSQL 16.10 on x86_64-pc-linux-musl, compiled by gcc (Alpine 14.2.0) 14.2.0, 64-bit

SELECT '2025-09-18T16:00:00.000+07:00'::timestamptz;

2025-09-18 09:00:00+00

SHOW DateStyle;

ISO, MDY

SHOW lc_time;

en_US.utf8

SHOW TimeZone;

UTC

SHOW client_encoding;

UTF8

oh I see I using cockroachDB as an instance of Postgresql database, maybe problem exists here

This definitely could be the reason. While CockroachDB is Postgres-compatible, it is not Postgres. Its timestamp parsing is implemented in Go and is stricter. That exact error (“unexpected separator ‘"’ for field Year … wanted: [Year Month Day …]”) is Cockroach’s Go-style parser complaining that the value it’s trying to parse starts with a double quote.

You may have to switch to using execute statement operation and try to cast required types explicitly.

2 Likes

thank for your support

1 Like

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