How to Schedule a job in AWS RDS postgreSQL - postgresql

I have one AWS RDS PostgreSQL instance, is there any way we can schedule a job that will call any PostgreSQL method as we do in SQL server to call procedure/method from job?

Related

Use Terraform on Google Cloud SQL Postgres to create a Replication Slot

Overall I'm trying to create a Datastream Connection to a Postgres database in Cloud SQL.
As I'm trying to configure it all through Terraform, I'm stuck on how I should create a Replication Slot. This guide explains how to do it through the Postgres Client and running SQL commands, but I thought there might be a way to do it in the Terraform configuration directly.
Example SQL that I would like to replicate in Terraform:
ALTER USER [CURRENT_USER] WITH REPLICATION;
CREATE PUBLICATION [PUBLICATION_NAME] FOR ALL TABLES;
SELECT PG_CREATE_LOGICAL_REPLICATION_SLOT('[REPLICATION_SLOT_NAME]', 'pgoutput');
If not, does anyone know how to run the Postgres SQL commands against the Cloud SQL database through Terraform?
I have setup the Datastream and Postgres connection for all other parts. I'm expecting that there is a Terraform setting I'm missing or a way to run Postgres commands against the Google Cloud SQL Postgres database.
Unfortunately, there is no terraform resource for specifying a replication slot on a google_sql_database_instance.

Refresh postgres materialized view using scheduler

I was trying to figure-out how we can schedule to refresh the materialized view on azure postgres database single server which is in azure cloud, one solution is to use pg_cron extension, but it
seems it is only available on azure flexible postgres database server and not on azure postgres database single server, I did not get any other option available, any suggestion in this regard will be really helpful.
I did not find any postgres scheduler extension for the db hosted on Azure, so created one microservice to schedule the db functions.
Example Link

Invoke a lambda function from a PostgresSQL trigger

I have a server built with sam local start-api using a PostgreSQL database running in a Docker container.
I'd like to invoke a lambda function that sends emails via AWS SES on the execution of a trigger in the PostgreSQL database. Is this something possible to achieve?

PostgreSQL Job Scheduler on Azure DB for PostgreSQL

In Azure Database for PostgreSQL, how do I install a pgAgent?
As, its a PaaS only, I will not have access to the Server. In that case, if I need a pgAgent to install, how do I do it?
As per azure docs, it seems PgCron is available in flexible server type.

Automate DB restore from DB snapshot PostgreSQL AWS

I have a Postgres instance on AWS from which snapshots are taken daily. I have manually restored the latest snapshot to another instance for reporting purpose,
but I'm wondering if it is possible to automate this so I can restore the snapshots daily?
You can schedule the restoration CLI command to get executed on particular event or at particular time.
aws rds restore-db-instance-from-db-snapshot --db-instance-identifier mynewdbinstance --db-snapshot-identifier mydbsnapshot