Select, delete json node postgres

Describe the problem/error/question

I have a RAG IA with supabase.
I need to make a RAG IA with postgres, but there are some commands in the supabase node that I don’t know how to use in the postgres node

Please share your workflow



Information on your n8n setup

  • n8n version: 1.64.2
  • Database (default: SQLite): Postgres 16
  • n8n EXECUTIONS_PROCESS setting (default: own, main): how do I see it?
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Unraid

I solved this by creating a query in postgres:

DELETE

DELETE FROM documents
WHERE metadata->>‘file_id’ ILIKE ‘%’ || ‘{{ $json.file_id }}’ || ‘%’;

INSERT
Still searching…

1 Like

Hey @brauliodiasribeiro,

You are on the right lines because Supabase sits on top of the database it makes things easier to do but if you go back to just the database itself you would need to work out what sql query Supabase is using to achive your goal.

INSERT
Still looking for a solution

Hey @brauliodiasribeiro,

Which insert are you after?

I need execute “match_documents” in postgres.

I thought you were after insert, This looks like it might be a select. match_documents looks to be a function that is added by supabase / pgvector, you can find some info on it here along with the definition.

I need to do a Select and an Insert. Both use this match. I’ll try…thanks for the help

Hi,

Did you figure it up?

I am trying to the delete a document.

My metoda hes four fields, one of them is file_id. I find it impossible to get or delete document by this :confused:

Ok, did it myself :slight_smile:

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