I need to set variable in db scope what will containt django user id what making DML query. something like this :
CREATE OR REPLACE FUNCTION set_user_id(auser_id integer)
RETURNS void AS
'GD["user_id"] = auser_id'
LANGUAGE plpythonu VOLATILE
COST 100;
and call this function before every DML to pass that user id into audit trigger; Is there is an easy way to do it?