Skip to content
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

ERROR: Child table given does not exist (schema_1.log_table1_p2023_12) while running maintenance proc #586

Closed
UtkarshDixit6 opened this issue Nov 1, 2023 · 1 comment

Comments

@UtkarshDixit6
Copy link

HI,
I am explaining the issue from architecture pint of view so that you guys can get the real exact picture of the issue :

I have two partition table in same DB but different schema like the below
Database Structure
schema_1.log_table1
schema_2.log_table2

for both the tables have partition exits like this :
Partitions: log_table1_p2022_10 FOR VALUES FROM ('2022-10-01 00:00:00+00') TO ('2022-11-01 00:00:00+00'), log_table1_p2022_11 FOR VALUES FROM ('2022-11-01 00:00:00+00') TO ('2022-12-01 00:00:00+00'), log_table1_p2022_12 FOR VALUES FROM ('2022-12-01 00:00:00+00') TO ('2023-01-01 00:00:00+00'), log_table1_p2023_01 FOR VALUES FROM ('2023-01-01 00:00:00+00') TO ('2023-02-01 00:00:00+00'), log_table1_p2023_02 FOR VALUES FROM ('2023-02-01 00:00:00+00') TO ('2023-03-01 00:00:00+00'), log_table1_p2023_03 FOR VALUES FROM ('2023-03-01 00:00:00+00') TO ('2023-04-01 00:00:00+00'), log_table1_p2023_04 FOR VALUES FROM ('2023-04-01 00:00:00+00') TO ('2023-05-01 00:00:00+00'), log_table1_p2023_05 FOR VALUES FROM ('2023-05-01 00:00:00+00') TO ('2023-06-01 00:00:00+00'), log_table1_p2023_06 FOR VALUES FROM ('2023-06-01 00:00:00+00') TO ('2023-07-01 00:00:00+00'), log_table1_p2023_07 FOR VALUES FROM ('2023-07-01 00:00:00+00') TO ('2023-08-01 00:00:00+00'), log_table1_p2023_11 FOR VALUES FROM ('2023-11-01 00:00:00+00') TO ('2023-12-01 00:00:00+00'), log_table1_p2023_12 FOR VALUES FROM ('2023-12-01 00:00:00+00') TO ('2024-01-01 00:00:00+00'), log_table1_archive DEFAULT

        Partitions: log_table2_p2022_10 FOR VALUES FROM ('2022-10-01 00:00:00+00') TO ('2022-11-01 00:00:00+00'),
        log_table2_p2022_11 FOR VALUES FROM ('2022-11-01 00:00:00+00') TO ('2022-12-01 00:00:00+00'),
        log_table2_p2022_12 FOR VALUES FROM ('2022-12-01 00:00:00+00') TO ('2023-01-01 00:00:00+00'),
        log_table2_p2023_01 FOR VALUES FROM ('2023-01-01 00:00:00+00') TO ('2023-02-01 00:00:00+00'),
        log_table2_p2023_02 FOR VALUES FROM ('2023-02-01 00:00:00+00') TO ('2023-03-01 00:00:00+00'),
        log_table2_p2023_03 FOR VALUES FROM ('2023-03-01 00:00:00+00') TO ('2023-04-01 00:00:00+00'),
        log_table2_p2023_04 FOR VALUES FROM ('2023-04-01 00:00:00+00') TO ('2023-05-01 00:00:00+00'),
        log_table2_p2023_05 FOR VALUES FROM ('2023-05-01 00:00:00+00') TO ('2023-06-01 00:00:00+00'),
        log_table2_p2023_06 FOR VALUES FROM ('2023-06-01 00:00:00+00') TO ('2023-07-01 00:00:00+00'),
        log_table2_p2023_07 FOR VALUES FROM ('2023-07-01 00:00:00+00') TO ('2023-08-01 00:00:00+00'),
        log_table2_p2023_11 FOR VALUES FROM ('2023-11-01 00:00:00+00') TO ('2023-12-01 00:00:00+00'),
        log_table2_p2023_12 FOR VALUES FROM ('2023-12-01 00:00:00+00') TO ('2024-01-01 00:00:00+00'),
        log_table2_archive DEFAULT

So when I have executed the select partman.run_maintenance(); - partition tables are getting created for log_table2 table but not for the log_table1 table and throwing following error :

Child table given does not exist (schema_1.log_table1_p2023_12) CONTEXT: PL/pgSQL function show_partition_info(text,text,text) line 38 at RAISE SQL statement "SELECT child_start_time FROM partman.show_partition_info(v_parent_schema||'.'||v_last_partition, v_row.partition_interval, v_row.parent_table)" PL/pgSQL function partman.run_maintenance(text,boolean,boolean) line 196 at SQL statement DETAIL: HINT: CONTEXT: PL/pgSQL function partman.run_maintenance(text,boolean,boolean) line 402 at RAISE

@UtkarshDixit6
Copy link
Author

child tables got created in different schema

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant