So here is my problem,
I have a procedure with :
DECLARE
serialvar INTEGER;
BEGIN
serialvar := NEW.battery_serial;
CREATE OR REPLACE VIEW battery_vue
AS
SELECT * FROM cells WHERE battery_serial = serialvar;
RETURN NEW;
END;
but when the trigger of that procedure is activated i have an error saying :
ERROR: the column « serialvar » does not exist
LINE 3: SELECT * FROM cells WHERE battery_serial = serialVar
TEMPORARY VIEW? It will be dropped at the end of session and will not conflict with other sessions. Details here.