Im trying to create a database in postgresql using linux.
I connected to postgres with  
sudo -u postgres psql postgres 
postgres=# then i tried **CREATE DATABASE demo** or **createdb demo**
but none of them worked when i checked with \l command.
Any help ?
sudo su - postgres to become postgres
then psql -c "create database demo" to create it from shell
first:
    sudo su postgres
and then enter your password then type:
     psql
and type this command:
    CREATE DATABASE dbname;
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With