I have a query as a transaction, using BEGIN
and COMMIT
. When I run this as a query it succeeds, however when I run it through pg_cron
I receive the following error:
FATAL: EndTransactionBlock: unexpected state BEGIN
BEGIN;TRUNCATE app_top50;INSERT INTO xxx...;COMMIT;
Googling the error returns very few results.