Обсуждение: need help on pg_cron setup for partition

Поиск
Список
Период
Сортировка

need help on pg_cron setup for partition

От
Sathish Reddy
Дата:

Hello All,
In RDS postgres(version 14.4), we have scheduled partition maintenance
through pg_partman and it's scheduled through pg_cron as below. The same
script has been executed in dev and test environments, and we are seeing
the cron job is scheduled in both environments because we see one record in
table cron.job.

But we are not seeing any entries in cron.job_run_details for the test
database and also partitions are not getting created/dropped as we have
expected on the test database. So it means it's not running in one of the
databases. Wondering why it is so, if we are missing anything? How to debug
this issue ,find the cause if it's failing internally for some reason and
fix it ?

select partman.create_parent(
p_parent_table := 'TAB1',
p_control := 'part_col',
p_type := 'native',
p_interval := '1 day',
p_premake := 5,
p_start_partition => '2024-02-01 00:00:00'
);

update partman.part_config set infinite_time_partitions = 'true' ,
retention = '1 months', retention_keep_table='true',
retention_keep_index='true'
where parent_table = 'TAB1';

SELECT cron.schedule('@daily',partman.run_maintenance());

Regards
sathish reddy

Re: need help on pg_cron setup for partition

От
Nisarg Patel
Дата:
You will need to correct the syntax if you are calling a function:

SELECT cron.schedule('@daily','select partman.run_maintenance()');

On Thu, Jun 20, 2024, 3:18 AM Sathish Reddy <sathishreddy.postgresql@gmail.com> wrote:

Hello All,
In RDS postgres(version 14.4), we have scheduled partition maintenance
through pg_partman and it's scheduled through pg_cron as below. The same
script has been executed in dev and test environments, and we are seeing
the cron job is scheduled in both environments because we see one record in
table cron.job.

But we are not seeing any entries in cron.job_run_details for the test
database and also partitions are not getting created/dropped as we have
expected on the test database. So it means it's not running in one of the
databases. Wondering why it is so, if we are missing anything? How to debug
this issue ,find the cause if it's failing internally for some reason and
fix it ?

select partman.create_parent(
p_parent_table := 'TAB1',
p_control := 'part_col',
p_type := 'native',
p_interval := '1 day',
p_premake := 5,
p_start_partition => '2024-02-01 00:00:00'
);

update partman.part_config set infinite_time_partitions = 'true' ,
retention = '1 months', retention_keep_table='true',
retention_keep_index='true'
where parent_table = 'TAB1';

SELECT cron.schedule('@daily',partman.run_maintenance());

Regards
sathish reddy

Monitoring Script for Postgres

От
Naveed Iftikhar
Дата:
Hi PostgreSQL Admin Team,

  I am new to PostgreSQL Database. I have provisioned few databases on RHEL. Need help and advise on how to setup basic database level monitoring like service status, tablespaces thresholds , buffer memory threshold, replication lag etc.  Please suggest if any extensions are suitable for the PostgreSQL monitoring. What to avoid third party enterprise tools. 

Best Regards
 -Naveed-

Re: Monitoring Script for Postgres

От
Kashif Zeeshan
Дата:

On Fri, Jun 21, 2024 at 6:35 AM Naveed Iftikhar <naveed27c@yahoo.com> wrote:
Hi PostgreSQL Admin Team,

  I am new to PostgreSQL Database. I have provisioned few databases on RHEL. Need help and advise on how to setup basic database level monitoring like service status, tablespaces thresholds , buffer memory threshold, replication lag etc.  Please suggest if any extensions are suitable for the PostgreSQL monitoring. What to avoid third party enterprise tools. 

Best Regards
 -Naveed-

Re: Monitoring Script for Postgres

От
Naveed Iftikhar
Дата:
Thanks Kashif.

Best Regards
 -Naveed-


On Thursday, June 20, 2024 at 10:28:15 PM CDT, Kashif Zeeshan <kashi.zeeshan@gmail.com> wrote:



On Fri, Jun 21, 2024 at 6:35 AM Naveed Iftikhar <naveed27c@yahoo.com> wrote:
Hi PostgreSQL Admin Team,

  I am new to PostgreSQL Database. I have provisioned few databases on RHEL. Need help and advise on how to setup basic database level monitoring like service status, tablespaces thresholds , buffer memory threshold, replication lag etc.  Please suggest if any extensions are suitable for the PostgreSQL monitoring. What to avoid third party enterprise tools. 

Best Regards
 -Naveed-

RE: Monitoring Script for Postgres

От
Дата:

Pg_catalog tables have all details no need any extension or tool required , tool extract information pg_catalog  and incormation_schema 

 

From: Naveed Iftikhar <naveed27c@yahoo.com>
Sent: Friday, June 21, 2024 12:27 PM
To: Kashif Zeeshan <kashi.zeeshan@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Monitoring Script for Postgres

 

Thanks Kashif.

 

Best Regards

 -Naveed-

 

 

On Thursday, June 20, 2024 at 10:28:15 PM CDT, Kashif Zeeshan <kashi.zeeshan@gmail.com> wrote:

 

 

 

On Fri, Jun 21, 2024 at 6:35 AM Naveed Iftikhar <naveed27c@yahoo.com> wrote:

Hi PostgreSQL Admin Team,

 

  I am new to PostgreSQL Database. I have provisioned few databases on RHEL. Need help and advise on how to setup basic database level monitoring like service status, tablespaces thresholds , buffer memory threshold, replication lag etc.  Please suggest if any extensions are suitable for the PostgreSQL monitoring. What to avoid third party enterprise tools. 

 

Best Regards

 -Naveed-

Re: Monitoring Script for Postgres

От
Naveed Iftikhar
Дата:
Thanks a lot Lennam. 

Best Regards
 -Naveed-


On Sunday, June 23, 2024 at 07:38:59 AM CDT, <lennam@incisivetechgroup.com> wrote:


Pg_catalog tables have all details no need any extension or tool required , tool extract information pg_catalog  and incormation_schema 

 

From: Naveed Iftikhar <naveed27c@yahoo.com>
Sent: Friday, June 21, 2024 12:27 PM
To: Kashif Zeeshan <kashi.zeeshan@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Monitoring Script for Postgres

 

Thanks Kashif.

 

Best Regards

 -Naveed-

 

 

On Thursday, June 20, 2024 at 10:28:15 PM CDT, Kashif Zeeshan <kashi.zeeshan@gmail.com> wrote:

 

 

 

On Fri, Jun 21, 2024 at 6:35 AM Naveed Iftikhar <naveed27c@yahoo.com> wrote:

Hi PostgreSQL Admin Team,

 

  I am new to PostgreSQL Database. I have provisioned few databases on RHEL. Need help and advise on how to setup basic database level monitoring like service status, tablespaces thresholds , buffer memory threshold, replication lag etc.  Please suggest if any extensions are suitable for the PostgreSQL monitoring. What to avoid third party enterprise tools. 

 

Best Regards

 -Naveed-