Here's how I solved my problem, at least for now. This approached was inspired by the helpful replies I received, though it does not exactly replicate any of them.
I took these steps on the test system: aptitude remove bacula-common bacula-common-pgsql bacula-console bacula-director bacula-director-pgsql aptitude purge bacula-common bacula-common-pgsql bacula-console bacula-director bacula-director-pgsql, when given the option during the purge command, delete all data. aptitude install bacula-common bacula-common-pgsql bacula-console bacula-director bacula-director-pgsql This creates an (almost) empty bacula database with encoding SQL_ASCII. As user postgres, rename that database. ALTER DATABASE bacula RENAME TO btemplate; Then, use the renamed database as a template to create new empty bacula databases as needed during iterative development and testing of my sqlite to postgres migration process. As user postgres, CREATE DATABASE bacula WITH TEMPLATE btemplate; Then a command along the lines of su - -s /bin/bash -c 'time psql bacula </somewhere/bacula.psql' bacula loads in the converted data. Ken -----Original Message----- From: kjohn...@eclypse.org [mailto:kjohn...@eclypse.org] Sent: Tuesday, May 04, 2021 5:15 PM To: 'bacula-users' Subject: Re: [Bacula-users] postgres createdb for bacula fails All, I want to thank Michel Figgins, Dan Langille, Dimitri Maziuk, and Serio Gelato for replying to my request for help. I'm working on it, but a variety of circumstances mean it will probably be a couple of days before I have results. Thanks. Ken -----Original Message----- From: kjohn...@eclypse.org [mailto:kjohn...@eclypse.org] Sent: Monday, May 03, 2021 5:17 PM To: 'bacula-users' Subject: [Bacula-users] postgres createdb for bacula fails As time permits, I am working on an sqlite to postgres conversion of a bacula database, in preparation for upgrading from Debian 9 to Debian 10. For a variety of reasons I believe I am pretty close. But... There are three systems involved: the live server (Debian 9), the system where the database conversion occurs, and a test system (Debian 9) that I am using to confirm to the extent possible that the database conversion has been successful. The next step in my testing is to create an empty bacula database on the test system and restore it from the pg_dump file created on the conversion system. I have learned that the bacula postgres database needs to have encoding SQL_ASCII. Here's the difficulty. As user bacula on the test system: $ export LC_ALL=C $ createdb -E SQL_ASCII -T template0 bacula createdb: database creation failed: ERROR: encoding "SQL_ASCII" does not match locale "en_US.UTF-8" DETAIL: The chosen LC_CTYPE setting requires encoding "UTF8". Probably, fixing this is something that everyone else knows. Unfortunately, my Google searches find too much or almost nothing. A specific search of the mailing list archive found a discussion of why SQL_ASCII was so important (circa 2009), but not an answer to this problem. At least, not one that I recognized. (same failure without the export, by the way). The documentation for Bacula 7.4 (https://www.bacula.org/7.4.x-manuals/en/main/Installing_Configuring_Post.ht ml) also states that SQL_ASCII is essential, but I did not recognize a solution to this problem there. bacula 7.4.4 postgres 9.6 A solution to this problem, or a fairly tight direction to the relevant documentation would be very much appreciated. Thanks in advance for your attention. Ken _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users