Re: Problem with commit in function

2018-10-30 Thread Christoph Moench-Tegeder
## Mike Martin (redt...@gmail.com): > Subject: Problem with commit in function You can't commit inside a FUNCTION - and there's an obvious ERROR if you try to do that: "invalid transaction termination". Only since version 11 you can use a PROCEDURE and COMMIT/ROLLBAC

Problem with commit in function

2018-10-30 Thread Mike Martin
I have the following function -- FUNCTION: public.update_log() -- DROP FUNCTION public.update_log(); CREATE OR REPLACE FUNCTION public.update_log( ) RETURNS void LANGUAGE 'sql' COST 100 VOLATILE AS $BODY$ truncate table postgres_log_tmp ; COPY postgres_log_tmp FROM '/mnt/pgdata