Skip to content

Placeholders error No parameter $1 #86

@monos26

Description

@monos26

hello,
I recently used your node to connect with Timescaledb. When I send to the database a series of values ​​that I periodically collect on an electrical measuring station using placeholders I have "error: there is no parameter $1". When I replace the placeholders with the values ​​in the "query" of the node the values ​​are sent correctly.

in the postgresql logs

2024-09-04 14:27:13.601 CEST [10175] postgres@postgres ERROR: there is no parameter $1 at character 243
[
    {
        "id": "eae3ad61b7f9e437",
        "type": "debug",
        "z": "a50509a2ef5a252d",
        "name": "debug 1",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 2540,
        "y": 1000,
        "wires": []
    },
    {
        "id": "a7aa0e48a1e86923",
        "type": "postgresql",
        "z": "a50509a2ef5a252d",
        "name": "dirisa40",
        "query": "INSERT INTO sensor_data (\n    time, \n    amp1, \n    amp2, \n    amp3, \n    amp_neutre, \n    volt_U12, \n    volt_U23, \n    volt_U31, \n    volt_phase1, \n    volt_phase2, \n    volt_phase3, \n    fréquence,\n    sensor_id\n) VALUES (\n    NOW(), \n    $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12\n);\n",
        "postgreSQLConfig": "a28f75b585b49dfe",
        "split": false,
        "rowsPerMsg": "12",
        "outputs": 1,
        "x": 2540,
        "y": 1060,
        "wires": [
            []
        ]
    },
    {
        "id": "b132a1f50ca9daeb",
        "type": "inject",
        "z": "a50509a2ef5a252d",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "[23.9,33.1,29.4,11.1,400.85,400.81,400.92,230.29,232.47,231.68,49.98,\"DirisA40\"]",
        "payloadType": "json",
        "x": 2150,
        "y": 1060,
        "wires": [
            [
                "eae3ad61b7f9e437",
                "a7aa0e48a1e86923"
            ]
        ]
    },
    {
        "id": "a28f75b585b49dfe",
        "type": "postgreSQLConfig",
        "name": "Timescaledb",
        "host": "192.168.1.51",
        "hostFieldType": "str",
        "port": "5432",
        "portFieldType": "num",
        "database": "postgres",
        "databaseFieldType": "str",
        "ssl": "false",
        "sslFieldType": "bool",
        "applicationName": "",
        "applicationNameType": "str",
        "max": "10",
        "maxFieldType": "num",
        "idle": "1000",
        "idleFieldType": "num",
        "connectionTimeout": "10000",
        "connectionTimeoutFieldType": "num",
        "user": "postgres",
        "userFieldType": "str",
        "password": "timescale",
        "passwordFieldType": "str"
    }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions