pg_partman
pg_partman copied to clipboard
Allow partitions to be created in separate schema
Please provide the capability of allowing partitions to be created in a separate schema. This would be very useful when there is a large number of partitions for a given table.
Potentially could add a new optional option to the partition functions called p_partition_schema that would allow us to pass in the schema.
Example of what we do today. This keeps the public schema clean and only contains the main/parent objects. All of the partition "magic" is hid away from our developers and users in the partitions schema.: CREATE SCHEMA partitions; CREATE TABLE public.test (created_at timestamp with time zone, field_1 text, field_2 text) PARTITION BY RANGE (created_at); CREATE TABLE IF NOT EXISTS partitions.test_p2023q1 PARTITION OF public.test FOR VALUES FROM ('2023-01-01') TO ('2023-04-01');
Thanks, -Chris
I'll investigate this after the refactor to 5.x