Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
public:postgresql_upgrade_on_freebsd [2023/09/25 16:51] – [Migrate data] jailhouse build Nicopublic:postgresql_upgrade_on_freebsd [2025/09/29 13:54] (current) – [A note about locales] deprecated locale issue Nico
Line 2: Line 2:
  
 For minimal downtime during migration, we will use `pg_upgrade` tool, which needs both old and new PostgreSQL binaries available. To do so, we will use FreeBSD's ports system, without `make clean` at first to keep compiled binaries. For minimal downtime during migration, we will use `pg_upgrade` tool, which needs both old and new PostgreSQL binaries available. To do so, we will use FreeBSD's ports system, without `make clean` at first to keep compiled binaries.
- 
 ## A note about locales ## A note about locales
  
-You might encounter weird locales issue while ensuing `initdb` command, like this:+You might encounter weird locale issue while ensuing `initdb` command, like this:
  
 ```bash ```bash
Line 11: Line 10:
 ``` ```
  
-The only workaround I found was to disable locale detection in the source code:+This seems to be caused by a [remaining deprecated locale](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274718#c12). You can delete it by using the following command, depending on if you're running PostgreSQL in a jail (I didn't find a cleaner way, sorry):
  
-```diff +```bash 
---- /var/ports/basejail/usr/ports/databases/postgresql15-server/work/postgresql-15.2/src/backend/utils/adt/pg_locale.c  2023-08-22 18:55:52.003715000 +0200 +sudo rm -rf /usr/share/locale/sr_YU.ISO8859-5 
-+++ /tmp/pg_locale.c    2023-08-22 18:54:40.437733000 +0200 +sudo rm -rf /basejail/usr/share/locale/sr_YU.ISO8859-5
-@@ -1727,8 +1727,8 @@ +
-                        freelocale(loc); +
-                } +
-                else +
--               //      ereport(ERROR, +
--               //                      (errmsg("could not load locale \"%s\"", collcollate))); +
-+                       ereport(ERROR, +
-+                                       (errmsg("could not load locale \"%s\"", collcollate))); +
- #elif defined(WIN32) && _WIN32_WINNT >= 0x0600 +
-                /+
-                 * If we are targeting Windows Vista and above, we can ask for a name+
 ``` ```
- 
-You can apply this patch while compiling new version's port (issue `make`, stop it with ctrl+c after download and extract, patch, then issue `make` again) 
  
 ## Compile old and new version from ports ## Compile old and new version from ports