I'm currently inserting this data {"curr": "testcurr","nm": "testnm"}
to a view.
A trigger function is then run to insert into the original tables instead.
I'm getting an error column "curr" does not exist from the trigger function.
Here is the part of my code:
IF (tg_op = 'INSERT') THEN
NEW."dat"= jsonb_build_object("curr",NEW."curr","symb",NEW."symb");
NEW."ct"=now();
INSERT INTO data.tbl
(
"nm",
"dat",
"ct",
)
VALUES
(
NEW."nm",
NEW."dat"
NEW."ct"
)returning "id" into NEW.id;
END
As you can see, the original table does not contain the 'curr' column, but my post data shouldn't have any problem right?