Empty postgres tables and then refill it with a csv file

heyy,
I am trying to make a workflow where I upload data from csv files (skills_fr.csv , skills_en.csv , skills_de.csv) into postgres table but before that i have to delete the old data existing in the table when the column language is the same as the new data will be entering

I have the following workflow : read from file then I start a loop, within this loop ,I put delete postgre when language equals to {{ $(‘Read/Write Files from Disk1’).item.json[‘fileName’].slice(-6, -4) }} and then next in the loop , I have extract from csv and finally the insert into postgres table : => the problem here when exectuting extarct node , it must use the ouput of read node not the output of the delete , I keep changing the input of extarct and I always get this error

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @rahma_charfeddine

Thanks for posting here and welcome to the community! :cake:

Can you please share your workflow, ideally with some pinned data. It’s a bit hard to follow just from your description :sweat_smile:

Tip for sharing your workflow in the forum

Pasting your n8n workflow


Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.

```
<your workflow>
```

Make sure that you’ve removed any sensitive information from your workflow and include dummy data or pinned data as much as you can!


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