
{"id":4016,"date":"2023-05-17T07:40:08","date_gmt":"2023-05-17T07:40:08","guid":{"rendered":"https:\/\/test.opensource-db.in\/wp1\/?p=4016"},"modified":"2023-09-13T05:41:22","modified_gmt":"2023-09-13T05:41:22","slug":"introducing-pg_cron-the-automation-task-master","status":"publish","type":"post","link":"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/","title":{"rendered":"Introducing pg_cron &#8211; The Automation task master"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"538\" src=\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1-1024x538.png\" alt=\"\" class=\"wp-image-4026\" srcset=\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1-1024x538.png 1024w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1-300x158.png 300w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1-768x403.png 768w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1-1536x807.png 1536w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1-188x99.png 188w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1-152x80.png 152w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1-394x207.png 394w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1-915x481.png 915w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1-1240x651.png 1240w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1.png 1801w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The pg_cron extension is a PostgreSQL extension that allows you to schedule regular database tasks using the familiar cron syntax. Any tasks that need to be done at regular intervals, such as data archiving, partitioning, creating or deleting backup sets, etc. can be automated using pg_cron.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Installation the pg_cron extension:<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Install the pg_cron extension dependencies: The pg_cron extension depends on the <strong>libpq<\/strong> and <strong>libcron<\/strong> libraries. Install these dependencies using the package manager of your operating system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Modify PostgreSQL configuration: Open the postgresql.conf file of your PostgreSQL installation and add the following line to enable the pg_cron extension:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>postgres=# alter system set shared_preload_libraries = 'pg_cron';<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"448\" height=\"106\" src=\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/image1.png\" alt=\"\" class=\"wp-image-4052\" srcset=\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/image1.png 448w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/image1-300x71.png 300w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/image1-418x99.png 418w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/image1-338x80.png 338w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/image1-394x93.png 394w\" sizes=\"(max-width: 448px) 100vw, 448px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><code>postgres=# Alter system set cron.databasename = \u2018postgres\u2019;<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"421\" height=\"99\" src=\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/image2.png\" alt=\"\" class=\"wp-image-4056\" srcset=\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/image2.png 421w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/image2-300x71.png 300w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/image2-340x80.png 340w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/image2-394x93.png 394w\" sizes=\"(max-width: 421px) 100vw, 421px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Restart the PostgreSQL service to apply the configuration changes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>Systemctl restart postgresql.service<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create the pg_cron extension:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>postgres=# create extension pg_cron;<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"416\" height=\"41\" src=\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/image3.png\" alt=\"\" class=\"wp-image-4059\" srcset=\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/image3.png 416w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/image3-300x30.png 300w, https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/image3-394x39.png 394w\" sizes=\"(max-width: 416px) 100vw, 416px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Verifying pg_cron installation<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Below is an example to schedule a vacuum task. The expression used for the scheduler is similar to any other scheduled cron job on the linux operating system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>postgres=# SELECT cron.schedule('2 * * * *', 'vacuum');<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>schedule \n----------\n        2<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><img loading=\"lazy\" decoding=\"async\" width=\"538\" height=\"102\" src=\"blob:https:\/\/test.opensource-db.in\/wp1\/6cc08e9f-ec8c-48f3-bb89-e3af3f4985e2\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We can check the output of the schedule 2 as following in the log<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>2023-05-16 21:32:00.015 IST &#91;60387] LOG:  cron job 2 starting: vacuum\n2023-05-16 21:32:00.064 IST &#91;60387] LOG:  cron job 2 COMMAND completed: VACUUM\n2023-05-16 21:33:26.019 IST &#91;60381] LOG:  checkpoint starting: time\n\n2023-05-16 21:33:28.333 IST &#91;60381] LOG:  checkpoint complete: wrote 23 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=2.308 s, sync=0.002 s, total=2.315 s; sync files=10, longest=0.001 s, average=0.001 s; distance=107 kB, estimate=464 kB<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">We can check the history in the <code>cron.job_run_details<\/code> table as follows.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>postgres=# select * from cron.job_run_details ;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">jobid | runid | job_pid | database | username |&nbsp; &nbsp; &nbsp; command &nbsp; &nbsp; &nbsp; |&nbsp; status &nbsp; |&nbsp; return_message &nbsp; |&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8212;&#8212;-+&#8212;&#8212;-+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+-<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3 |&nbsp; &nbsp; 28 | &nbsp; 60541 | postgres | postgres | vacuum &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | succeeded | VACUUM&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1 | &nbsp; &nbsp; 1 | &nbsp; &nbsp; &nbsp; &nbsp; | postgres | postgres | select * from emp; | failed&nbsp; &nbsp; | connection failed |&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"47\" src=\"blob:https:\/\/test.opensource-db.in\/wp1\/a76d1c28-8476-405e-bd9e-30144f6425fd\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We can check all the scheduled cron jobs as following command<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>postgres=# select * from cron.job;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"116\" src=\"blob:https:\/\/test.opensource-db.in\/wp1\/e3f31fc9-8bd1-46ae-b861-714eb4433d88\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To unschedule a job using the job id<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img loading=\"lazy\" decoding=\"async\" width=\"388\" height=\"97\" src=\"blob:https:\/\/test.opensource-db.in\/wp1\/b815fd7d-7d36-46cf-8a60-a6755ec0fb4b\"><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Conclusion:<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">You have successfully installed the pg_cron extension in your PostgreSQL database. You can now start scheduling tasks using pg_cron to automate your routine database activities on Postgres by following the examples above. Using pg_cron can help save on some of the developers and DBAs time, which could then be used for something more critical or productive,&nbsp; and also add a layer of efficiency to the business processes by reducing human dependency.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The pg_cron extension is a PostgreSQL extension that allows you to schedule regular database tasks using the familiar cron syntax. [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[23,42,73],"tags":[45,37,24,44,26],"class_list":["post-4016","post","type-post","status-publish","format-standard","hentry","category-postgresql-14","category-postgresql-15","category-scheduling-extension","tag-open-source-databases","tag-postgres","tag-postgres14","tag-postgres15","tag-postgresql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Introducing pg_cron - The Automation task master - OpenSource DB<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Introducing pg_cron - The Automation task master - OpenSource DB\" \/>\n<meta property=\"og:description\" content=\"The pg_cron extension is a PostgreSQL extension that allows you to schedule regular database tasks using the familiar cron syntax. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/\" \/>\n<meta property=\"og:site_name\" content=\"OpenSource DB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/people\/OpenSource-DB\/100072970755470\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-17T07:40:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-13T05:41:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1-1024x538.png\" \/>\n<meta name=\"author\" content=\"Venkat Akhil\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@opensource_db\" \/>\n<meta name=\"twitter:site\" content=\"@opensource_db\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Venkat Akhil\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/\"},\"author\":{\"name\":\"Venkat Akhil\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/a37b142ecbf953189a4f9209b0b8d328\"},\"headline\":\"Introducing pg_cron &#8211; The Automation task master\",\"datePublished\":\"2023-05-17T07:40:08+00:00\",\"dateModified\":\"2023-09-13T05:41:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/\"},\"wordCount\":355,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#organization\"},\"image\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1-1024x538.png\",\"keywords\":[\"open-source databases\",\"postgres\",\"postgres14\",\"postgres15\",\"postgresql\"],\"articleSection\":[\"PostgreSQL 14\",\"PostgreSQL 15\",\"Scheduling Extension\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/\",\"name\":\"Introducing pg_cron - The Automation task master - OpenSource DB\",\"isPartOf\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1-1024x538.png\",\"datePublished\":\"2023-05-17T07:40:08+00:00\",\"dateModified\":\"2023-09-13T05:41:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/#primaryimage\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1.png\",\"contentUrl\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1.png\",\"width\":1801,\"height\":946},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/test.opensource-db.in\/wp1\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Introducing pg_cron &#8211; The Automation task master\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#website\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/\",\"name\":\"OpenSource DB\",\"description\":\"Your Trusted OpenSource Databases partner\",\"publisher\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/test.opensource-db.in\/wp1\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#organization\",\"name\":\"OPENSOURCE DB PRIVATE LIMITED\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2021\/10\/osdb-logo-tm-2.png\",\"contentUrl\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2021\/10\/osdb-logo-tm-2.png\",\"width\":368,\"height\":120,\"caption\":\"OPENSOURCE DB PRIVATE LIMITED\"},\"image\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/people\/OpenSource-DB\/100072970755470\/\",\"https:\/\/x.com\/opensource_db\",\"https:\/\/www.youtube.com\/channel\/UCmTI5h\",\"https:\/\/www.linkedin.com\/company\/opensource-db\",\"https:\/\/www.instagram.com\/opensource_db\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/a37b142ecbf953189a4f9209b0b8d328\",\"name\":\"Venkat Akhil\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/522c0947d21b2c2c89f10698fd9131f9db4110f65c8d02b53d9b4559c7650865?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/522c0947d21b2c2c89f10698fd9131f9db4110f65c8d02b53d9b4559c7650865?s=96&d=mm&r=g\",\"caption\":\"Venkat Akhil\"},\"url\":\"https:\/\/test.opensource-db.in\/wp1\/author\/sudheer-sopensource-db-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Introducing pg_cron - The Automation task master - OpenSource DB","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"Introducing pg_cron - The Automation task master - OpenSource DB","og_description":"The pg_cron extension is a PostgreSQL extension that allows you to schedule regular database tasks using the familiar cron syntax. [&hellip;]","og_url":"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/","og_site_name":"OpenSource DB","article_publisher":"https:\/\/www.facebook.com\/people\/OpenSource-DB\/100072970755470\/","article_published_time":"2023-05-17T07:40:08+00:00","article_modified_time":"2023-09-13T05:41:22+00:00","og_image":[{"url":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1-1024x538.png","type":"","width":"","height":""}],"author":"Venkat Akhil","twitter_card":"summary_large_image","twitter_creator":"@opensource_db","twitter_site":"@opensource_db","twitter_misc":{"Written by":"Venkat Akhil","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/#article","isPartOf":{"@id":"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/"},"author":{"name":"Venkat Akhil","@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/a37b142ecbf953189a4f9209b0b8d328"},"headline":"Introducing pg_cron &#8211; The Automation task master","datePublished":"2023-05-17T07:40:08+00:00","dateModified":"2023-09-13T05:41:22+00:00","mainEntityOfPage":{"@id":"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/"},"wordCount":355,"commentCount":0,"publisher":{"@id":"https:\/\/test.opensource-db.in\/wp1\/#organization"},"image":{"@id":"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/#primaryimage"},"thumbnailUrl":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1-1024x538.png","keywords":["open-source databases","postgres","postgres14","postgres15","postgresql"],"articleSection":["PostgreSQL 14","PostgreSQL 15","Scheduling Extension"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/","url":"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/","name":"Introducing pg_cron - The Automation task master - OpenSource DB","isPartOf":{"@id":"https:\/\/test.opensource-db.in\/wp1\/#website"},"primaryImageOfPage":{"@id":"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/#primaryimage"},"image":{"@id":"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/#primaryimage"},"thumbnailUrl":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1-1024x538.png","datePublished":"2023-05-17T07:40:08+00:00","dateModified":"2023-09-13T05:41:22+00:00","breadcrumb":{"@id":"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/#primaryimage","url":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1.png","contentUrl":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2023\/05\/blog-image-1.png","width":1801,"height":946},{"@type":"BreadcrumbList","@id":"https:\/\/test.opensource-db.in\/wp1\/introducing-pg_cron-the-automation-task-master\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/test.opensource-db.in\/wp1\/"},{"@type":"ListItem","position":2,"name":"Introducing pg_cron &#8211; The Automation task master"}]},{"@type":"WebSite","@id":"https:\/\/test.opensource-db.in\/wp1\/#website","url":"https:\/\/test.opensource-db.in\/wp1\/","name":"OpenSource DB","description":"Your Trusted OpenSource Databases partner","publisher":{"@id":"https:\/\/test.opensource-db.in\/wp1\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/test.opensource-db.in\/wp1\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/test.opensource-db.in\/wp1\/#organization","name":"OPENSOURCE DB PRIVATE LIMITED","url":"https:\/\/test.opensource-db.in\/wp1\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/logo\/image\/","url":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2021\/10\/osdb-logo-tm-2.png","contentUrl":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2021\/10\/osdb-logo-tm-2.png","width":368,"height":120,"caption":"OPENSOURCE DB PRIVATE LIMITED"},"image":{"@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/people\/OpenSource-DB\/100072970755470\/","https:\/\/x.com\/opensource_db","https:\/\/www.youtube.com\/channel\/UCmTI5h","https:\/\/www.linkedin.com\/company\/opensource-db","https:\/\/www.instagram.com\/opensource_db\/"]},{"@type":"Person","@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/a37b142ecbf953189a4f9209b0b8d328","name":"Venkat Akhil","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/522c0947d21b2c2c89f10698fd9131f9db4110f65c8d02b53d9b4559c7650865?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/522c0947d21b2c2c89f10698fd9131f9db4110f65c8d02b53d9b4559c7650865?s=96&d=mm&r=g","caption":"Venkat Akhil"},"url":"https:\/\/test.opensource-db.in\/wp1\/author\/sudheer-sopensource-db-com\/"}]}},"rttpg_featured_image_url":null,"rttpg_author":{"display_name":"Venkat Akhil","author_link":"https:\/\/test.opensource-db.in\/wp1\/author\/sudheer-sopensource-db-com\/"},"rttpg_comment":0,"rttpg_category":"<a href=\"https:\/\/test.opensource-db.in\/wp1\/category\/postgres\/postgresql-14\/\" rel=\"category tag\">PostgreSQL 14<\/a> <a href=\"https:\/\/test.opensource-db.in\/wp1\/category\/postgres\/postgresql-15\/\" rel=\"category tag\">PostgreSQL 15<\/a> <a href=\"https:\/\/test.opensource-db.in\/wp1\/category\/postgres\/postgresql-15\/scheduling-extension\/\" rel=\"category tag\">Scheduling Extension<\/a>","rttpg_excerpt":"The pg_cron extension is a PostgreSQL extension that allows you to schedule regular database tasks using the familiar cron syntax. [&hellip;]","_links":{"self":[{"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/posts\/4016","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/comments?post=4016"}],"version-history":[{"count":18,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/posts\/4016\/revisions"}],"predecessor-version":[{"id":4436,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/posts\/4016\/revisions\/4436"}],"wp:attachment":[{"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/media?parent=4016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/categories?post=4016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/tags?post=4016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}