20240226_step1.sql 394 B

1234567891011121314151617181920
  1. -- PROCEDURE: public.sp_write_log()
  2. -- DROP PROCEDURE IF EXISTS public.sp_write_log();
  3. CREATE OR REPLACE PROCEDURE public.sp_write_log(
  4. in message text,
  5. in data ANYELEMENT
  6. )
  7. LANGUAGE 'plpgsql'
  8. AS $BODY$
  9. begin
  10. if coalesce(message, '') != '' then
  11. insert into public.application_log_history(started, message, data)
  12. values (now(), message, row_to_json(data));
  13. end if;
  14. end;
  15. $BODY$;