Welcome.
Here is the problem (one of my friends)
create function remove_picture()
RETURNS OPAQUE AS '
DECLARE
field_name TEXT;
BEGIN
field_name := TG_ARGV[0];
DELETE FROM picture WHERE picture_id=OLD.field_name;
RETURN OLD;
END;
'
He needs create universal function for many tables to remowe record
(dont want to use references (FK))
create sql statment
DELETE FROM picture WHERE picture_id=OLD.field_name;
field_name is field name not the same name for this tables.
DELETE FROM picture WHERE picture_id=OLD.'field_name';
Sorry for my english
Best Regareds
--
/*
Kto nie pyta ten błądzi.
Kto pyta ten błądzi z innymi
*/