# Create data in postgres

**URL:** https://discourse.nodered.org/t/create-data-in-postgres/45063
**Category:** General
**Created:** [2 May 2021 15:39 UTC](https://discourse.nodered.org/t/create-data-in-postgres/45063 "2021-05-02T15:39:13Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![grandautism](https://avatars.discourse-cdn.com/v4/letter/g/b5ac83/32.png) [@grandautism](https://discourse.nodered.org/u/grandautism)
#### Post date: [2 May 2021 15:39 UTC](https://discourse.nodered.org/t/create-data-in-postgres/45063/1 "2021-05-02T15:39:14Z")

</div>

hello, I am using the node red for the first time, I try to stock data in postgresql.  
I currently need to find a solution, but nothing works, can you tell me what i do wrong ?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/6/b6a683e0bea663c5e692972f1e0f9a5bfcd618f7.png)  
function insert:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/9/d9f5c7f1f49ee75061f0b575e2a90816f78e5356.png)

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [2 May 2021 15:42 UTC](https://discourse.nodered.org/t/create-data-in-postgres/45063/2 "2021-05-02T15:42:16Z")

</div>

The first thing you need to do is tell us what you have tried

---

<div class="post-metadata">

### Author: ![grandautism](https://avatars.discourse-cdn.com/v4/letter/g/b5ac83/32.png) [@grandautism](https://discourse.nodered.org/u/grandautism)
#### Post date: [2 May 2021 15:48 UTC](https://discourse.nodered.org/t/create-data-in-postgres/45063/3 "2021-05-02T15:48:22Z")

</div>

I started with a simple program but it didn't work

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/3/5310f5ae067c90d8a7b9b8eca9c753c560e21fe0.png)  
nothing is displayed in my postgres  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/1/c1a0424503f22242e674c42c8303504ec1f68b04.png)

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [2 May 2021 15:56 UTC](https://discourse.nodered.org/t/create-data-in-postgres/45063/4 "2021-05-02T15:56:39Z")

</div>

> [@grandautism](#):
>
> I currently need to find a solution, but nothing works, can you tell me what i do wrong

What node is it. Have you read the built in help? Have you read the readme for that node?

I ask because many of the SQL nodes expect the query to be in topic.

---

<div class="post-metadata">

### Author: ![grandautism](https://avatars.discourse-cdn.com/v4/letter/g/b5ac83/32.png) [@grandautism](https://discourse.nodered.org/u/grandautism)
#### Post date: [2 May 2021 17:09 UTC](https://discourse.nodered.org/t/create-data-in-postgres/45063/5 "2021-05-02T17:09:02Z")

</div>

i used the node-red-contrib-postgrestor-next biblio.  
must I add a function or something like that ?  
if anyone has already send data to postgres, can you share with me your code ?

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [2 May 2021 18:11 UTC](https://discourse.nodered.org/t/create-data-in-postgres/45063/6 "2021-05-02T18:11:59Z")

</div>

What settings do you have in the node-red-contrib-postgrestor-next node?

---

<div class="post-metadata">

### Author: ![grandautism](https://avatars.discourse-cdn.com/v4/letter/g/b5ac83/32.png) [@grandautism](https://discourse.nodered.org/u/grandautism)
#### Post date: [2 May 2021 18:41 UTC](https://discourse.nodered.org/t/create-data-in-postgres/45063/7 "2021-05-02T18:41:55Z")

</div>

here is my node's setting

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/8/98dac26464a4e06a19cc5e4031c4f23cd75ccc48.png)  
I tried node-red-contrib-re-postgres biblio, same prob

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [3 May 2021 00:16 UTC](https://discourse.nodered.org/t/create-data-in-postgres/45063/8 "2021-05-03T00:16:48Z")

</div>

So is Postgres installed on the same device that node-red is?

---

<div class="post-metadata">

### Author: ![grandautism](https://avatars.discourse-cdn.com/v4/letter/g/b5ac83/32.png) [@grandautism](https://discourse.nodered.org/u/grandautism)
#### Post date: [3 May 2021 09:02 UTC](https://discourse.nodered.org/t/create-data-in-postgres/45063/9 "2021-05-03T09:02:19Z")

</div>

yes, on the same device.. do i should add something else ?

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [3 May 2021 09:40 UTC](https://discourse.nodered.org/t/create-data-in-postgres/45063/10 "2021-05-03T09:40:39Z")

</div>

I just wanted to make sure it was on the same device. Now what is your query?  
Have you read the nodes read me?

---

<div class="post-metadata">

### Author: ![grandautism](https://avatars.discourse-cdn.com/v4/letter/g/b5ac83/32.png) [@grandautism](https://discourse.nodered.org/u/grandautism)
#### Post date: [3 May 2021 10:31 UTC](https://discourse.nodered.org/t/create-data-in-postgres/45063/11 "2021-05-03T10:31:24Z")

</div>

I found where is the problem, the code should be inserted inside the potgres node  
My query is like that:  
msg.params = ['{{payload.id}}', '{{payload.value}}']  
return msg;

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [3 May 2021 11:41 UTC](https://discourse.nodered.org/t/create-data-in-postgres/45063/12 "2021-05-03T11:41:28Z")

</div>

Congradulations!!

---

<div class="post-metadata">

### Author: ![grandautism](https://avatars.discourse-cdn.com/v4/letter/g/b5ac83/32.png) [@grandautism](https://discourse.nodered.org/u/grandautism)
#### Post date: [3 May 2021 11:56 UTC](https://discourse.nodered.org/t/create-data-in-postgres/45063/13 "2021-05-03T11:56:45Z")

</div>

yhank you but it didn't work with multiple inputs

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [3 May 2021 13:31 UTC](https://discourse.nodered.org/t/create-data-in-postgres/45063/14 "2021-05-03T13:31:51Z")

</div>

There is no point saying that unless you show us what doesn't work and in what way it doesn't work.

---

<div class="post-metadata">

### Author: ![grandautism](https://avatars.discourse-cdn.com/v4/letter/g/b5ac83/32.png) [@grandautism](https://discourse.nodered.org/u/grandautism)
#### Post date: [3 May 2021 14:36 UTC](https://discourse.nodered.org/t/create-data-in-postgres/45063/15 "2021-05-03T14:36:39Z")

</div>

I serve the problem, thank you all

---

<div class="post-metadata">

### Author: ![nurmosfet](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nurmosfet/32/49198_2.png) [@nurmosfet](https://discourse.nodered.org/u/nurmosfet)
#### Post date: [8 October 2021 01:45 UTC](https://discourse.nodered.org/t/create-data-in-postgres/45063/16 "2021-10-08T01:45:28Z")

</div>

Hai... have you solved it ?  
if you don't mind please what you have done to solved it..  
i have the same issue.. thanks
