Search code examples
postgresqlinstallationpg-cron

How do I install the pg_cron extension in Postgres 13 hosted in my Windows 10


I see a few guides for installing the pg_cron extension in windows, but its very confusing. Is there any guide that can help? A simple create extension in the database doesnt work. I get the below error :

ERROR:  could not open extension control file "C:/Program Files/PostgreSQL/13/share/extension/pg_cron.control": No such file or directory
SQL state: 58P01

Solution

  • You have to install the extension first.

    Since you are using Windows, things will get complicated. You need a C compiler and build instructions from source. There are no such build instructions available, but somebody has managed to do it before and suggested modifications that were never merged.

    Based on this and my personal experience with pg_cron bugs, I have the feeling that Microsoft doesn't care for this project very much, and that you will have a hard time getting it to run on Windows.

    Alternatively, you could try your luck with pg_timetable, but you'd have to build that from source too.

    You might end up using pgAgent, for which pre-built Windows binaries exist.