I'm trying to update large amount of rows (20,000) rows, so i created a temp table similar to this one. and i want to create a trigger on insertion or update and a function to take the inserted or updated data and updated in the B table where identifier column is the unique id in both A and B tables
The structure of both tables will be something like this:
- user (text)
- identifier (text)
- product (text)
- status (text)
- sales (numeric)
- purchase (numeric).
how to write a trigger and a function in postgreSQL to update data in B table on insert or update in A table?
Note I want to insert the data in a temp or normal table AKA(A table) and then do the update in B table with SQL only