Skip to content

Postgres Query Parameters break when a text parameter includes a comma #16354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
DimaUndSo opened this issue Jun 15, 2025 · 3 comments · May be fixed by #16366
Open

Postgres Query Parameters break when a text parameter includes a comma #16354

DimaUndSo opened this issue Jun 15, 2025 · 3 comments · May be fixed by #16366
Labels
in linear Issue or PR has been created in Linear for internal review

Comments

@DimaUndSo
Copy link

DimaUndSo commented Jun 15, 2025

Bug Description

I refer here to the same issue that was already "Closed as not planned":
https://github.com/n8n-io/n8n/issues/14955

Closing this is ridiculous, please fix it, as you can't use the Postgres node properly right now with this error.
It needs weird workarounds, editing the text to remove the commas.. this is not the way it should be.

To Reproduce

  1. Configure a Postgres node for the Execute Query operation.
  2. Set the Query to use multiple parameters, e.g.: INSERT INTO your_table (text_col, timestamp_col) VALUES ($1, $2);
  3. In the node "Options", add the "Query Parameters" field.
  4. Enter an expression that evaluates to a comma-separated string where the first value contains a comma, e.g.:
  5. {{ $json.textWithCommas }},{{ $json.ISOTimeStamp }}
  6. Execute the node.

Expected behavior

The node should correctly parse the comma-separated string provided in the "Query Parameters" field. It should assign the full string "Text data, with a comma" to $1 and the string "2025-01-01T12:00:00Z" to $2, allowing the parameterised query to execute successfully against the database.

Operating System

Ubuntu Linux

n8n Version

1.97.1

Node.js Version

v20.19.0

Database

PostgreSQL

Execution mode

main (default)

@Joffcom
Copy link
Member

Joffcom commented Jun 15, 2025

Hey @DimaUndSo,

We have created an internal ticket to look into this which we will be tracking as "GHC-2548"

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Jun 15, 2025
@DimaUndSo DimaUndSo changed the title Query Parameters break when a text parameter includes a comma Postgres Query Parameters break when a text parameter includes a comma Jun 15, 2025
@xing5
Copy link

xing5 commented Jun 15, 2025

There's an issue with postgres text array field as well. When upsert completes, the array field in input data is mutated.

@DimaUndSo
Copy link
Author

I fixed the error and made a pull request:
#16366

Hope its getting merged soon. Works now for me :)

Vunovati added a commit to Vunovati/n8n that referenced this issue Jun 15, 2025
…-io#16354)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review
Projects
None yet
3 participants