-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run_maintenance_proc() does not create new partitions #449
Comments
Can you share the schema of your table and the |
Can you also run |
Answering your questions just solved the problem: |
Not a problem. Glad I was able to help narrow down the issue. |
insert into public.part_config (parent_table, control, partition_type, partition_interval, constraint_cols, premake, optimize_trigger, optimize_constraint, epoch, inherit_fk, retention, retention_schema, retention_keep_table, retention_keep_index, infinite_time_partitions, datetime_string, automatic_maintenance, jobmon, sub_partition_set_full, undo_in_progress, trigger_exception_handling, upsert, trigger_return_null, template_table, publications, inherit_privileges, constraint_valid, subscription_refresh, drop_cascade_fk, ignore_default_data)
values ('public.payments', 'created_at', 'native', '1 mon', null, 1, 4, 30, 'none', true, null, null, true, true, false, 'YYYY_MM', 'on', true, false, false, false, '', true, 'public.template_public_payments', null, false, true, null, false, false); after run_maintenance('public.payments') partitions doesn't created |
Can anyone help me please ? 🙏 |
@alifengineer unless you are seeing the same errors as this person reported, please open a new issue. Also please browse through existing closed issues for people that have reported the same problem of new partitions not being made to see if they may solve your issue |
Thanks, problem is solved. I have another one question @keithf4, Why in that case after canceling request advisory block left ? If i close this client connection and open new new connection it run without problem. Advisory block also removed. |
That is how advisory locks work. https://www.postgresql.org/docs/16/explicit-locking.html#ADVISORY-LOCKS Due to it being a procedure and not a regular function, the maintenance procedure takes out a non-transactional, session level advisory lock that must be manually closed to be run again within the same session. That manual close is at the end of the procedure which you've cancelled before it finishes. If you allow it to finish it will cleanly release the advisory lock. Non-transactional advisory locks are based on the session so if you close the session it automatically releases it. |
I have some monthly partitioned tables that are configured to pre-make 4 partitions. Data is inserted every day and partition maintenance is run every first day of a month. Calling
run_maintenance_proc()
worked for all of the tables until 1st of April. On that day for some of the tables no new partitions were created and I got the following error message:To fix the error, I set infinite_time_partitions to
true
, but when I callrun_maintenance_proc()
I still get the same error message.Do I miss something?
I use pg_partman 4.5.1 on cloud-sql Postgres 13.
The text was updated successfully, but these errors were encountered: