Hi Colin,
I don't see anything coming out of the db node - it's like it isn't doing anything at all...
Here is the requested startup of Node-Red in the terminal:
Microsoft Windows [Version 10.0.17763.379]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\Users\Administrator>node-red
10 Aug 11:14:36 - [info]
Welcome to Node-RED
===================
10 Aug 11:14:36 - [info] Node-RED version: v1.1.0
10 Aug 11:14:36 - [info] Node.js version: v14.5.0
10 Aug 11:14:36 - [info] Windows_NT 10.0.17763 x64 LE
10 Aug 11:14:39 - [info] Loading palette nodes
10 Aug 11:14:49 - [info] Dashboard version 2.22.1 started at /ui
10 Aug 11:14:50 - [info] Settings file : \Users\Administrator\.node-red\settings.js
10 Aug 11:14:50 - [info] Context store : 'default' [module=memory]
10 Aug 11:14:50 - [info] User directory : \Users\Administrator\.node-red
10 Aug 11:14:50 - [warn] Projects disabled : editorTheme.projects.enabled=false
10 Aug 11:14:50 - [info] Flows file : \Users\Administrator\.node-red\flows_WIN-NR2019.json
10 Aug 11:14:50 - [info] Server now running at http://127.0.0.1:1880/
10 Aug 11:14:50 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
10 Aug 11:14:50 - [info] Starting flows
10 Aug 11:14:50 - [info] Started flows
10 Aug 11:29:19 - [info] Stopping flows
10 Aug 11:29:19 - [info] Stopped flows
10 Aug 11:29:19 - [info] Starting flows
10 Aug 11:29:19 - [info] Started flows
10 Aug 11:33:43 - [info] Stopping flows
10 Aug 11:33:43 - [info] Stopped flows
10 Aug 11:33:43 - [info] Starting flows
10 Aug 11:33:43 - [info] Started flows
10 Aug 11:33:49 - [info] [debug:fb664bf6.df2548]
{
_msgid: '5f367f7b.8431f',
payload: "insert into dev (content) values ('test1')",
topic: '',
queryParameters: {}
}
10 Aug 12:05:35 - [info] Stopping flows
10 Aug 12:05:35 - [info] Stopped flows
10 Aug 12:05:35 - [info] Starting flows
10 Aug 12:05:35 - [info] Started flows
10 Aug 12:46:03 - [info] Stopping flows
10 Aug 12:46:03 - [info] Stopped flows
10 Aug 12:46:03 - [info] Starting flows
10 Aug 12:46:04 - [info] Started flows
10 Aug 12:46:19 - [info] Stopping flows
10 Aug 12:46:19 - [info] Stopped flows
10 Aug 12:46:19 - [info] Starting flows
10 Aug 12:46:19 - [info] Started flows
10 Aug 12:46:33 - [info] Stopping flows
10 Aug 12:46:33 - [info] Stopped flows
10 Aug 12:46:33 - [info] Starting flows
10 Aug 12:46:33 - [info] Started flows
10 Aug 12:47:25 - [info] Stopping flows
10 Aug 12:47:25 - [info] Stopped flows
10 Aug 12:47:25 - [info] Starting flows
10 Aug 12:47:25 - [info] Started flows
It seems that the node doesn't work with nodejs 14.
If the node had a github repository then you could submit an issue, but since there does not seem to be one then it seems there is not much you can do other than downgrade nodejs or use a different postgres node. Did you choose that one for a particular reason.
Hi Colin, very interesting... I din't select this one for any reason in particular, I just need one that works as expected. Can you PLEASE suggest a node that will work in my environment?
I haven't used any of those nodes, and I suspect no-one here has, in which case you may just have to try them. I would start by looking at their github repositories (which should be linked from the page on the node-red flows site), see whether they are maintained and look at the Issues to see if they are being addressed.
This is great news, at least this is working but now comes the real reason for getting a working PostgreSQL node...
I want to inject the results of an API call into the database table called 'sensors', here is what is happening in the flow which is bypassing the PostgreSQL node for now:
Or perhaps @jomacdon meant to put the code using the moustache syntax in a Template node to expand the parameters and then feed that into the postgres node.
i know .. but it seems that this node-red-contrib-postgrestor-next node
doesnt accept a 'custom made' sql query
so my suggestion was to remove the template, get the values from the API and structure them in a msg.params array using a function and test like this
I think it unlikely that you cannot give it a fully defined query with no variable parameters. In fact I imagine that is how @jomacdon initially tested it, though I don't know that.
can you show as seperate screenshots of debugs from API request and function node ?
(and extend the view of debug from API to see how the value stucture is)
set debugs to complete msg
and also if you can repost your flow with the latest changes ?