Home > Back-end >  Psql - 'database does not exists' while it does and was created in Valentina Studio
Psql - 'database does not exists' while it does and was created in Valentina Studio

Time:10-24

I have started to learn about SQL and installed Valentina Studio & PSQL on my Ubuntu.

I have defined a password via sudo -u postgres psql postgres and then \password postgres.

Then I have entered Valentina Studio and connected to this server with 'discover localhost server- it found thePostgresSQL` and I entered the password that I set up before in the terminal and it looked ok and like it was connected.

I have created 4 empty new databases in the VStudio and tried to import to them some databases which are located on my desktop.

I got the database does not exist while it sure does as you can see in the screenshot. When I tried to do the same with template1 the skelton database of psql, it worked.

But why the Vstudio and the PSQL are not connected to each other?

enter image description here

CodePudding user response:

Example of recreating template1 database in psql as postgres user.

update pg_database set datistemplate = 'f' where datname = 'template1';
drop database template1;
create database template1 template template0 is_template true ;
  • Related