How to know the locale that has been used to initialize a Postgres server? I need it in order to create a new database with initdb with the same locale, otherwise pg_upgrade will fail.
One option is to use psql -l, but it outputs many lines if there a lot of databases.