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

Create index removal procedure #515

Open
keithf4 opened this issue Mar 22, 2023 · 4 comments
Open

Create index removal procedure #515

keithf4 opened this issue Mar 22, 2023 · 4 comments

Comments

@keithf4
Copy link
Collaborator

keithf4 commented Mar 22, 2023

Create a procedure that, given a table name, will drop all of its indexes. Use this procedure during retention maintenance and also document its usefulness outside of pg_partman.

@keithf4 keithf4 added this to the Future milestone Mar 22, 2023
@vitaly-burovoy
Copy link
Contributor

What is purpose of dropping indexes by default?

If anyone moves¹ retention tables to an archive via dump/restore, this function will do a disservice.

Getting an index deletion DDL is a one-line query (and can be wrapped to be executed in DO command²). It is better to document how to do it instead of perform it.


¹ Otherwise why to leave them?
² https://www.postgresql.org/docs/current/sql-do.html

@keithf4
Copy link
Collaborator Author

keithf4 commented Jun 30, 2023

I made no mention of this being a default action. This is just to provide a procedure to make it easier to do if desired.

@vitaly-burovoy
Copy link
Contributor

Oops… Sorry.

I thought it will be default because of phrase "Use this procedure during retention maintenance" without conditions.

O:-)

@keithf4
Copy link
Collaborator Author

keithf4 commented Jul 2, 2023

No problem. Index removal is already part of retention maintenance. Was just a note for myself to make sure I got back and use the new code there.

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

No branches or pull requests

2 participants