Re: COLLATION update in 13.1

Laurenz Albe <laurenz.albe@cybertec.at>

From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Matthias Apitz <guru@unixarea.de>
Cc: pgsql-general@lists.postgresql.org
Date: 2025-03-28T07:17:04Z
Lists: pgsql-general
On Fri, 2025-03-28 at 07:37 +0100, Matthias Apitz wrote:
> Anyway, does it make sense to ALTER COLLATION in these databases as well?
> > 
> > I would say so, yes.  At least on the template you are using for new databases.
> 
> $ psql -Upostgres template0
> Passwort für Benutzer postgres:
> psql: FATAL:  database "template0" is not currently accepting connections
> $
> 
> With 'template1' and 'postgres' it works fine.

You'd have to temporarily allow connections and reset it once you are done.

  ALTER DATABASE template0 ALLOW_CONNECTIONS TRUE;
  \c template0
  ALTER COLLATION ... REFRESH VERSION;
  ALTER DATABASE template0 ALLOW_CONNECTIONS FALSE;
  \q

Yours,
Laurenz Albe