Search code examples
postgresqlpgagent

PG_Agent doesn't execute query


Hi I am trying to run a few querys with PG_Agent in my Postgres Database but it won't work. If I copy the Statement and run it manually it works just perfect. So there must be an error with pgagent or maybe some permissions.

Copy (select * from public."table1") TO 'D:\\Export\\Data\\Archive.csv' WITH (FORMAT CSV, HEADER);

This is my pgpass file:

localhost:5432:*:postgres:*password*

Does anyone have a solution or had the same problem? I googled for hours and no solution helped me out. Thanks


Solution

  • I have a Solution: I realised that pgagent doesn't work with postgre 15 in my case. I installed version 16 and migrated my database. Now everything works fine.