Hi All,
I am trying to connect to a postgres database using the node "node-red-contrib-postgresql".
A bit of context about my config :
- Node-red is run on an ubuntu virtual machine
- Postgres SQL is run on the SAME ubuntu virtual machine, and file pg_hba & postgresql.conf have been modified to accept connections from all hosts
- I can connect to the database through Dbeaver
Here is the simple node I am trying to execute (took from the node's documentation) :
[
{
"id": "82b7c689d6682f72",
"type": "postgresql",
"z": "42e818e1032fede2",
"name": "ADD COLUMN",
"query": "ALTER TABLE iot.device_data\n DROP COLUMN IF EXISTS validity;\n\nALTER TABLE iot.device_data\n ADD COLUMN validity BOOLEAN;\n",
"postgreSQLConfig": "20ae1e52d1eef983",
"split": false,
"rowsPerMsg": "10",
"outputs": 1,
"x": 280,
"y": 180,
"wires": [
[
"c5f0b4b2442e3137"
]
]
},
{
"id": "20ae1e52d1eef983",
"type": "postgreSQLConfig",
"name": "dbtestiotstore",
"host": "20.199.13.132",
"hostFieldType": "str",
"port": "5432",
"portFieldType": "num",
"database": "iotstore",
"databaseFieldType": "str",
"ssl": "false",
"sslFieldType": "bool",
"applicationName": "",
"applicationNameType": "str",
"max": "10",
"maxFieldType": "num",
"idle": "1000",
"idleFieldType": "num",
"connectionTimeout": "10000",
"connectionTimeoutFieldType": "num",
"user": "hamza",
"userFieldType": "str",
"password": "HBmdp123456789*",
"passwordFieldType": "str"
}
]
here is the error I get :
I have tried changing the host to localhost & 127.0.0.1, but still without luck.
Happy to get your insights
Thanks,
HB