Postgresql issue at install [Solved]



I made a flectra installation on debian supplied through windows WSL2 with the following steps:

apt-get install postgresql -y
apt-get install gdebi
(note: installation through apt-get after registering the key as mentioned in the Flectra documentation was not working as the installer was complaining about invalid flectra.key)*
gdebi flectra_1.6.latest_all.deb
service postgresql start
service flectra start

Using the IP shown within a ifconfig command in the Debian WSL2 machine and connetcing to the webpage thatIP:7073 on the Windows host, I get the syart page of Flectra. Good!

Now the bad, when I fill the page to create a new database, I get the following error:

"Database creation error: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII) HINT: Use the same encoding as in the template database, or use template0 as template. "

Any hint ?

Thank you


Solved using the following approach:

sudo -u postgres psql postgres

then in psql console paste the following lines:

update pg_database set datallowconn = TRUE where datname = 'template0';
\c template0
update pg_database set datistemplate = FALSE where datname = 'template1';
drop database template1;
create database template1 with template = template0 encoding = 'UTF8';
update pg_database set datistemplate = TRUE where datname = 'template1';
\c template1
update pg_database set datallowconn = FALSE where datname = 'template0';

Press Ctrl-D to exit the psql console

Then restart the services:
service postgresql restart
service flectra restart