Skip to content

Tag: triggers

Using NEW and COPY in a Postgres Trigger

I’m trying to copy the last inserted row from a table into a csv file using a trigger. I’ve tried this in various incarnations, with or without EXECUTE but I’m still getting the error. Just cannot get it to access the NEW data. Where am I going wrong ? Answer Adrian’s answer inspired m…

Replacing a subquery in a PL/SQL trigger

I have 2 tables. One called Employee and the other Employee_jobs. One of the fields in the Employee table is job_name. The Employee_jobs table contains 2 fields, job_name, and Emp_count (number of employees per job). What i’m trying to do is whenever i perform an operation on the Employee table then it …