# Inject Data into Postgres

**URL:** <https://discourse.nodered.org/t/inject-data-into-postgres/31973>\
**Category:** General\
**Created:** [25 August 2020 07:47 UTC](https://discourse.nodered.org/t/inject-data-into-postgres/31973 "2020-08-25T07:47:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhswa](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@mhswa](https://discourse.nodered.org/u/mhswa)\
**Post date:** [25 August 2020 07:47 UTC](https://discourse.nodered.org/t/inject-data-into-postgres/31973/1 "2020-08-25T07:47:56Z")

</div>

Hi All

After going back to the drawing board after my previous post i need a little help understanding how to use templates and functions for my project

i have a postgresql database that i am trying to write to & query from user input and after hours of trial and error im not understanding 100%

to try and test to just query the data i am injecting a timestamp with my msg.topic to be the table i am trying to read from the mydb node the query is SELECT \* FROM {{msg.tableName}}; and my msg.topic is set to the table production\_dashboard\_dashboard i have tried a few combinations of this. the error i get from debug is "error: syntax error at or near ";""

my hope is to allow users via the UI in fill in data into forms and that data is written into my DB for our dashboard to query later on

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [25 August 2020 08:04 UTC](https://discourse.nodered.org/t/inject-data-into-postgres/31973/2 "2020-08-25T08:04:28Z")

</div>

Hi Matthew,

What _PostgreSQL_ node are you using?  
Can you post a flow of what you have tried ?

There was a similar topic discussed [here](https://discourse.nodered.org/t/insert-into-postgresql-database/31263/25) that you can study

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [24 October 2020 08:04 UTC](https://discourse.nodered.org/t/inject-data-into-postgres/31973/3 "2020-10-24T08:04:30Z")

</div>

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