News for hackers. Stuff that matters.
Re:Features I'd Like in PostgreSQL by pramsey on Saturday January 28, 2023 @06:00PM (#34562916)
update pg_index set indisvalid = false where indexrelid = 63514;
Re:Features I'd Like in PostgreSQL by ioltas on Saturday January 28, 2023 @07:38PM (#34563618)
It's been argued a few times that we should have the possibility to make an index invalid on sight with a proper ALTER INDEX command, yes.
Re:Features I'd Like in PostgreSQL by samokhvalov on Saturday January 28, 2023 @09:30PM (#34564287)
I see to use cases:

- disable for all - disable only for my session, to check what would happen with the plan, and only then decide to proceed with disabling for all (or to drop it)

ALTER is quite invasive way, even more than "UPDATE .. SET indisvalid = false ...". It would be good to do it via SET as it was proposed in the plantuner extension long ago.

Re:Features I'd Like in PostgreSQL by samokhvalov on Saturday January 28, 2023 @09:29PM (#34564274)
There is an opinion that it's unsafe: https://twitter.com/petervgeoghegan/status/15991919640456724...

There was an extension from Teodor some time ago, plantuner, to disable indexes in a session or globally ("set plantuner.forbid_index='id_idx2';") – but it didn't make it to core, and even to contribs. Maybe because the functionality to disable indexes was mixed with planner hints there. It's a very old story, discussion from 2009: https://www.postgresql.org/message-id/flat/47E63672-972E-452...