I am a complete beginner on PostgreSQL, and I am following an introduction to databases to set up a local PostgreSQL database and connect to it. I am running Debian 15, so I do the following:
# apt update # apt install postgresql
The installation is succesful. I then do:
sudo -u postgres psql psql (15.7 (Debian 15.7-0+deb12u1)) Type "help" for help. postgres=# \l postgres=# createdb prismatest postgres-# \l postgres-# \c prismatest connection to server on socket "/var/run/postgresql/.s.PGSQL.5433" failed: FATAL: database "prismatest" does not exist Previous connection kept
So the list of databases shows nothing and it is not possible to connect to the - supposedly - newly created database. My user has the rights:
postgres-# \du List of roles Role name | Attributes | Member of -----------+------------------------------------------------------------+----------- postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
Can anybody help me figure out what is going on? Thanks...
CREATE DATABASE prsimatest;