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

Add support for partitions to postgresql_table #372

Open
SiL3x opened this issue Nov 17, 2022 · 1 comment
Open

Add support for partitions to postgresql_table #372

SiL3x opened this issue Nov 17, 2022 · 1 comment

Comments

@SiL3x
Copy link

SiL3x commented Nov 17, 2022

SUMMARY

For larger databases it would be a nice improvement to be able to manage partitioned tables and partitions using the postgresql_table module.
Managing in this context includes (but is not limited to):

  • Creating partitioned tables
  • Attach & detach partitions
ISSUE TYPE
  • Feature Idea
COMPONENT NAME

postgresql_table

ADDITIONAL INFORMATION
  • This feature would be used while creating tables (see below for two ideas).
  • The ability to create and manage partitioned tables is important to work with big tables.
- name: Create test_table with several columns and partitioned by date range
  community.postgresql.postgresql_table:
    name: test_table
    columns:
    - id bigserial primary key
    - num bigint
    - date date
    partition: range (date)
- name: Create test_table_2022 with several columns and attach it to test_table
  community.postgresql.postgresql_table:
    name: test_table
    columns:
    - id bigserial primary key
    - num bigint
    - date date
    partition: of test_table for values from ('2022-01-01') to ('2023-01-01')
@hunleyd
Copy link
Collaborator

hunleyd commented Nov 17, 2022

Thinking about this a bit, I think there's a few new keys we might want:

partition_by: range, list, or hash
partition_on: <column>
partition_of: <parent table>

That should make validating the input for each easier I think

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

Successfully merging a pull request may close this issue.

2 participants