Skip to content

Instantly share code, notes, and snippets.

@Veka
Veka / README.md
Created January 13, 2025 08:24 — forked from troykelly/README.md
Rebuild and Refresh Collation Version for PostgreSQL

PostgreSQL Collation and Reindexing Utility

Overview

The reindex_and_refresh_collation.sh script is created to automate the process of reindexing tables and refreshing the collation version for all user databases in a PostgreSQL server. This utility is particularly useful when you've updated the locale or collation libraries on the system where PostgreSQL is installed, as these updates could cause mismatches between the databases' expected collation version and the operating system's provided version.

What It Does

  • Retrieves a list of all user databases (excluding system templates) on the PostgreSQL server.