
{"id":6298,"date":"2024-10-30T10:11:12","date_gmt":"2024-10-30T10:11:12","guid":{"rendered":"https:\/\/test.opensource-db.in\/wp1\/?p=6298"},"modified":"2024-11-22T10:32:00","modified_gmt":"2024-11-22T10:32:00","slug":"automating-postgresql-tasks-with-pg_cron","status":"publish","type":"post","link":"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/","title":{"rendered":"Automating PostgreSQL Tasks with pg_cron"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In the world of database management, automation is key to maintaining efficiency and ensuring that routine tasks are executed consistently. For PostgreSQL users, the <code>pg_cron<\/code> extension provides a powerful way to schedule jobs directly within the database. In this post, we\u2019ll explore what <code>pg_cron<\/code> is, how to install it, and how to use it effectively.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What is pg_cron?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>pg_cron<\/code> is an extension for PostgreSQL that allows you to run scheduled jobs using familiar cron syntax. With this, you can automate various tasks, such as database maintenance, data processing, and reporting, all from within your PostgreSQL environment. This eliminates the need for external cron jobs or scripts, making your setup cleaner and more integrated.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Installing pg_cron<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Identify the version of pg_cron that is compatible with your PostgreSQL installation. For example, to install the pg_cron (pg_cron_16) extension on PostgreSQL 16, run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#For RHEL \/ Fedora Derivatives:\nsudo yum install -y pg_cron_16\n\n#For Ubuntu \/ Debian Derivatives:\nsudo apt-get install -y postgresql-16-cron<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Setting Up pg_cron<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To start the <code>pg_cron<\/code> background worker when PostgreSQL starts, you need to add <code>pg_cron<\/code> to shared_preload_libraries in <code>postgresql.conf<\/code> . Note that <code>pg_cron<\/code> does not run any jobs while the server is in hot standby mode, but it automatically starts when the server is promoted.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By default, the <code>pg_cron<\/code> background worker expects its metadata tables to be created in the <code>postgres<\/code> database. However, you can configure this by setting the <code>cron.database_name<\/code> configuration parameter in <code>postgresql.conf<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#Parameters need to be change for pg_cron \nshared_preload_libraries = 'pg_cron'\ncron.database_name = 'postgres'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After changing the parameter and restarting the PostgreSQL server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can create the <code>pg_cron<\/code> and metadata tables using<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>postgres=# CREATE EXTENSION pg_cron;\nCREATE EXTENSION<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After creating extension, grant the <code>usage<\/code> privileges to user <code>postgres<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>postgres=# GRANT USAGE ON SCHEMA cron TO postgres;\nGRANT<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s <strong>schedule<\/strong> a <code>vacuum<\/code> operation on the <code>postgres<\/code> database at 10 P.M every day.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>postgres=# SELECT cron.schedule('0 22 * * *', 'VACUUM');\n schedule \n----------\n        1\n(1 row)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s see how we can manage the scheduled jobs<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>postgres=# SELECT * FROM cron.job;\n&nbsp;jobid | &nbsp;schedule &nbsp; | command | nodename &nbsp;| nodeport | database | username | active | jobname\n-------+-------------+---------+-----------+----------+----------+----------+--------+---------\n&nbsp; &nbsp; &nbsp;1 | 0 22 * * * &nbsp;| VACUUM &nbsp;| localhost | &nbsp; &nbsp; 5432 | postgres | postgres | t &nbsp; &nbsp; &nbsp;|\n(1 row)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To check the logs of the scheduled activities.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>postgres=# select * from cron.job_run_details;\n-&#091; RECORD 1 ]--+----------------------------------------------------------------------------------------------------------\njobid | 1\nrunid | 1\njob_pid | 35683\ndatabase | postgres\nusername | postgres\ncommand | VACUUM\nstatus | succeeded\nreturn_message | VACUUM\nstart_time | 2024-10-01 13:27:29.473088+05:30\nend_time | 2024-10-01 13:27:29.47479+05:30<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here, the breakdown of each field. <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>jobid :<\/strong> This is the unique identifier for the scheduled job. Each job scheduled in <code>pg_cron<\/code> has a distinct <code>jobid<\/code>.<\/li>\n\n\n\n<li><strong>runid :<\/strong> This indicates the unique identifier for this specific execution of the job. If the job is scheduled to run multiple times, each execution will have a different <code>runid<\/code>.<\/li>\n\n\n\n<li><strong>job_pid :<\/strong> This is the process ID of the PostgreSQL backend process that executed the job. It can be useful for tracking the job&#8217;s execution in system logs.<\/li>\n\n\n\n<li><strong>database :<\/strong> This shows the database context in which the job was run. In this case, the job was executed in the <code>postgres<\/code> database.<\/li>\n\n\n\n<li><strong>username :<\/strong> This indicates the username under which the job was executed. Here, the job ran as the <code>postgres<\/code> user.<\/li>\n\n\n\n<li><strong>command :<\/strong> This is the SQL command that was executed as part of the job. In this instance, it indicates that a <code>VACUUM<\/code> operation was performed.<\/li>\n\n\n\n<li><strong>status :<\/strong> This shows the outcome of the job execution. A status of <code>succeeded<\/code> indicates that the job completed successfully without errors.<\/li>\n\n\n\n<li><strong>return_message :<\/strong> This message reflects the output from the executed command. In this case, it confirms that the <code>VACUUM<\/code> command was executed.<\/li>\n\n\n\n<li><strong>start_time :<\/strong> This is the timestamp when the job started executing. It includes the time zone offset (<code>+05:30<\/code>), indicating the local time zone.<\/li>\n\n\n\n<li><strong>end_time :<\/strong> This is the timestamp when the job finished executing. It also includes the time zone offset.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">To <strong>unschedule<\/strong> a previously scheduled job in pg_cron, run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT cron.unschedule(job_id);<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>pg_cron<\/code> is a powerful tool that can significantly enhance your PostgreSQL experience by simplifying job scheduling and automation. By integrating routine tasks directly within the database, you can save time and reduce complexity. Whether you\u2019re handling maintenance, data processing, or reporting, <code>pg_cron<\/code> provides the flexibility and control you need. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ready to automate your PostgreSQL tasks? Give <code>pg_cron<\/code> a try, and see how it can streamline your database operations! Contact us today to know more about our database maintenance services.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Happy Automation!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the world of database management, automation is key to maintaining efficiency and ensuring that routine tasks are executed consistently. [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":6309,"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,89],"tags":[],"class_list":["post-6298","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-postgresql-14","category-postgresql-15","category-postgresql-16"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Automating PostgreSQL Tasks with pg_cron - 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=\"Automating PostgreSQL Tasks with pg_cron - OpenSource DB\" \/>\n<meta property=\"og:description\" content=\"In the world of database management, automation is key to maintaining efficiency and ensuring that routine tasks are executed consistently. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/\" \/>\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=\"2024-10-30T10:11:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-22T10:32:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"945\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Shameer Bhupathi\" \/>\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=\"Shameer Bhupathi\" \/>\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\/automating-postgresql-tasks-with-pg_cron\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/\"},\"author\":{\"name\":\"Shameer Bhupathi\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/422480fbefed0b2cee82aeab232110f5\"},\"headline\":\"Automating PostgreSQL Tasks with pg_cron\",\"datePublished\":\"2024-10-30T10:11:12+00:00\",\"dateModified\":\"2024-11-22T10:32:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/\"},\"wordCount\":589,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#organization\"},\"image\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1.png\",\"articleSection\":[\"PostgreSQL 14\",\"PostgreSQL 15\",\"PostgreSQL 16\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/\",\"name\":\"Automating PostgreSQL Tasks with pg_cron - OpenSource DB\",\"isPartOf\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1.png\",\"datePublished\":\"2024-10-30T10:11:12+00:00\",\"dateModified\":\"2024-11-22T10:32:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/#primaryimage\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1.png\",\"contentUrl\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1.png\",\"width\":1800,\"height\":945},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/test.opensource-db.in\/wp1\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Automating PostgreSQL Tasks with pg_cron\"}]},{\"@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\/422480fbefed0b2cee82aeab232110f5\",\"name\":\"Shameer Bhupathi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2cfa95999202132ded07acd24f6faf25dca145a6c3efe47919204f115ffbf625?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2cfa95999202132ded07acd24f6faf25dca145a6c3efe47919204f115ffbf625?s=96&d=mm&r=g\",\"caption\":\"Shameer Bhupathi\"},\"url\":\"https:\/\/test.opensource-db.in\/wp1\/author\/shameer-bhupathi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Automating PostgreSQL Tasks with pg_cron - 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":"Automating PostgreSQL Tasks with pg_cron - OpenSource DB","og_description":"In the world of database management, automation is key to maintaining efficiency and ensuring that routine tasks are executed consistently. [&hellip;]","og_url":"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/","og_site_name":"OpenSource DB","article_publisher":"https:\/\/www.facebook.com\/people\/OpenSource-DB\/100072970755470\/","article_published_time":"2024-10-30T10:11:12+00:00","article_modified_time":"2024-11-22T10:32:00+00:00","og_image":[{"width":1800,"height":945,"url":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1.png","type":"image\/png"}],"author":"Shameer Bhupathi","twitter_card":"summary_large_image","twitter_creator":"@opensource_db","twitter_site":"@opensource_db","twitter_misc":{"Written by":"Shameer Bhupathi","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/#article","isPartOf":{"@id":"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/"},"author":{"name":"Shameer Bhupathi","@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/422480fbefed0b2cee82aeab232110f5"},"headline":"Automating PostgreSQL Tasks with pg_cron","datePublished":"2024-10-30T10:11:12+00:00","dateModified":"2024-11-22T10:32:00+00:00","mainEntityOfPage":{"@id":"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/"},"wordCount":589,"commentCount":0,"publisher":{"@id":"https:\/\/test.opensource-db.in\/wp1\/#organization"},"image":{"@id":"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/#primaryimage"},"thumbnailUrl":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1.png","articleSection":["PostgreSQL 14","PostgreSQL 15","PostgreSQL 16"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/","url":"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/","name":"Automating PostgreSQL Tasks with pg_cron - OpenSource DB","isPartOf":{"@id":"https:\/\/test.opensource-db.in\/wp1\/#website"},"primaryImageOfPage":{"@id":"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/#primaryimage"},"image":{"@id":"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/#primaryimage"},"thumbnailUrl":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1.png","datePublished":"2024-10-30T10:11:12+00:00","dateModified":"2024-11-22T10:32:00+00:00","breadcrumb":{"@id":"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/#primaryimage","url":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1.png","contentUrl":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1.png","width":1800,"height":945},{"@type":"BreadcrumbList","@id":"https:\/\/test.opensource-db.in\/wp1\/automating-postgresql-tasks-with-pg_cron\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/test.opensource-db.in\/wp1\/"},{"@type":"ListItem","position":2,"name":"Automating PostgreSQL Tasks with pg_cron"}]},{"@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\/422480fbefed0b2cee82aeab232110f5","name":"Shameer Bhupathi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2cfa95999202132ded07acd24f6faf25dca145a6c3efe47919204f115ffbf625?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2cfa95999202132ded07acd24f6faf25dca145a6c3efe47919204f115ffbf625?s=96&d=mm&r=g","caption":"Shameer Bhupathi"},"url":"https:\/\/test.opensource-db.in\/wp1\/author\/shameer-bhupathi\/"}]}},"rttpg_featured_image_url":{"full":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1.png",1800,945,false],"landscape":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1.png",1800,945,false],"portraits":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1.png",1800,945,false],"thumbnail":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1-150x150.png",150,150,true],"medium":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1-300x158.png",300,158,true],"large":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1-1024x538.png",1024,538,true],"1536x1536":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1-1536x806.png",1536,806,true],"2048x2048":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1.png",1800,945,false],"ultp_layout_landscape_large":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1.png",1200,630,false],"ultp_layout_landscape":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1.png",870,457,false],"ultp_layout_portrait":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1.png",600,315,false],"ultp_layout_square":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2024\/10\/image-10-1.png",600,315,false]},"rttpg_author":{"display_name":"Shameer Bhupathi","author_link":"https:\/\/test.opensource-db.in\/wp1\/author\/shameer-bhupathi\/"},"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-16\/\" rel=\"category tag\">PostgreSQL 16<\/a>","rttpg_excerpt":"In the world of database management, automation is key to maintaining efficiency and ensuring that routine tasks are executed consistently. [&hellip;]","_links":{"self":[{"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/posts\/6298","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\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/comments?post=6298"}],"version-history":[{"count":7,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/posts\/6298\/revisions"}],"predecessor-version":[{"id":6576,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/posts\/6298\/revisions\/6576"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/media\/6309"}],"wp:attachment":[{"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/media?parent=6298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/categories?post=6298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/tags?post=6298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}