Bug - Postgres v2.5 query parameters comma issue

Describe the problem/error/question

When having a:

  • Postgres Node v2.5
  • Calling a query, with query parameters
    Then if one of the input has commas it will split the input in several parts (even with single quote around, and with the toggle option ON)

Ex: ‘MON, 21, 2023’ as $1, will be split into $1:‘MON’, $2:’ 21’, $3: ’ 2023’

What is the error message (if any)?

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

Information on your n8n setup

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

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:
  • n8n version: [email protected]
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): cloud
  • Operating system: mac

(Duplicate I guess of this bug report: Postgres Query Parameters ... bug?)

Hi @Kevin_Lourd1

Thanks for reporting this!
We will have a look internally and post an update here :pray:

1 Like

It seems the Postgres 2.5 node doesn’t recognise Boolean parameters properly either. Once again, 2.4 offers a temporary workaround but I obviously that can be a bit of hassle.

On Postgres node version 2.5 (Latest):

Claude Sonnet 3.5 with the assist :wink:

Working pattern (when strings might contain commas):

A query:

INSERT INTO
  local.statuses (
    user_id,
    progress,
    summary,
    reported_at,
    updated_at,
  )
SELECT 
  u.id,
  $2::text[], -- <---- this
  $3,
  NOW(),
  NOW()
FROM local.users u 
WHERE u.some_id = $1
RETURNING *;

Query params using a Javascript array to order params and curly braces to feed the $2::text slot in the Postgres query:

{{ [
  $('some_previous_node').first().json.user.id,
  '{' + $json.output.progress.join(',') + '}', // <---- this
  $json.output.summary
] }}

As i mentioned on the other linked post, I’m getting this bug as well on 2.5. Rolling back to 2.4 fixed it.

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