Number Guessing Game - Build a Number Guessing Game

Tell us what’s happening:
I seem to be stuck at The very 1st step of DB creation.

Your code so far

codeally@7146fd84bee5:~/project$ psql --username=freecodecamp --dbname=postgres
psql (12.9 (Ubuntu 12.9-2.pgdg20.04+1))
Type "help" for help.

postgres=> \l
postgres=> create database number_guess
postgres-> \c number_guess
connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL:  database "number_guess" does not exist
Previous connection kept
postgres-> \l
postgres-> \c template0
connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL:  database "template0" is not currently accepting connections
Previous connection kept
postgres-> create database test
postgres-> \c test
connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL:  database "test" does not exist
Previous connection kept
postgres-> help
Use \? for help or press control-C to clear the input buffer.
postgres-> 
postgres-> 
postgres-> 
postgres-> 
postgres-> 

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36

Challenge: Number Guessing Game - Build a Number Guessing Game

Link to the challenge:

i think you forgot to write the semicolon after each create statement.

Hey,

please note the difference in command prompt on the left:
postgres=>
&
postgres->

When you issue a command, you need to end it with a semicolon.
If you don’t, the program think you want to continue your command on
the following line.

Moreover, you should usually receive a result of the command like “Database was created” or “1 row was updated” or an error.

PS. This is not JavaScript where you can just omit a semicolon at the end the statement :smiley:

1 Like

thank you both!! i never realised the semi-colon made all the difference!!

1 Like