In a recent study Postgresql wrote a simple trigger
The create or replace function his_sdata. Student_delete_trigger ()
Returns the trigger as $$
The begin
The delete from his_sdata. Score where student_no=old. Student_no;
return old;
end;
$$
Language PLPGSQL;
Create the trigger delete_student_trigger
After the delete on his_sdata. Student
For each row execute procedure his_sdata. Student_delete_trigger ();
Then at the time of deleting data error:
A000 SQL ERROR [0] : ERROR: function always execute on segment because it issues a non - SELECT the statement (seg0 127.0.0.1:33000 pid=56887)
Detail:
SQL statement "delete from his_sdata. Score where student_no=$1"
PL/pgSQL function "student_delete_trigger" line 2 at the SQL statement
ERROR: function always execute on segment because it issues a non - SELECT the statement (seg0 127.0.0.1:33000 pid=56887)
Detail:
SQL statement "delete from his_sdata. Score where student_no=$1"
PL/pgSQL function "student_delete_trigger" line 2 at the SQL statement
ERROR: function always execute on segment because it issues a non - SELECT the statement (seg0 127.0.0.1:33000 pid=56887)
Detail:
SQL statement "delete from his_sdata. Score where student_no=$1"
PL/pgSQL function "student_delete_trigger" line 2 at the SQL statement