# The Postgresql DB does not exist

**URL:** <https://forum.greenbone.net/t/the-postgresql-db-does-not-exist/15239>\
**Category:** Linux Distribution and External Repo Discussion\
**Created:** [July 19, 2023, 8:47am UTC](https://forum.greenbone.net/t/the-postgresql-db-does-not-exist/15239 "2023-07-19T08:47:09Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![KeithClark](https://forum.greenbone.net/letter_avatar/keithclark/32/6_449c533f586939b6e5f246632a46421f.png) [@KeithClark](https://forum.greenbone.net/u/KeithClark)\
**Post date:** [July 24, 2023, 6:08pm UTC](https://forum.greenbone.net/t/the-postgresql-db-does-not-exist/15239/7 "2023-07-24T18:08:20Z")

</div>

Ive run into same issue and although the above persons fix gets me past the collation error I still have another which will always come up regardless of how many times i run it and re launch gvm-setup. It appears as although I am root the recomended FIX does not do anything.  
No LSB modules are available.  
Distributor ID: Kali  
Description: Kali GNU/Linux Rolling  
Release: 2023.2  
Codename: kali-rolling

```sh
sudo runuser -u postgres -- /usr/share/gvm/create-postgresql-database

──(root㉿kali)-[~]
└─# runuser -u postgres -- /usr/share/gvm/create-postgresql-database 
could not change directory to "/root": Permission denied
[i] User _gvm already exists in PostgreSQL
could not change directory to "/root": Permission denied

[*] Creating database
could not change directory to "/root": Permission denied
createdb: error: database creation failed: ERROR: template database "template1" has a collation version mismatch
DETAIL: The template database was created using collation version 2.36, but the operating system provides version 2.37.
HINT: Rebuild all objects in the template database that use the default collation and run ALTER DATABASE template1 REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
could not change directory to "/root": Permission denied

[*] Creating permissions
could not change directory to "/root": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist

[*] Applying permissions
could not change directory to "/root": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist
could not change directory to "/root": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist

[*] Creating extension uuid-ossp
could not change directory to "/root": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist
could not change directory to "/root": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist

[*] Creating extension pgcrypto
could not change directory to "/root": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist
could not change directory to "/root": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist

[*] Creating extension pg-gvm
could not change directory to "/root": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist
``
```

---

_[View the full topic](https://forum.greenbone.net/t/the-postgresql-db-does-not-exist/15239)._
