## 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
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