it seems like, its a cli issue, look at “scenario -1” after postgres its “->” where as in “senario-2” its in correct form “=>” thus its valid and not for previous command
They aren’t the same. A line starting = is the first line. If you hit enter without terminating a query ( ;), it will just give you a new line, which starts with a -
Edit: just for clarity, this line
postgres-> CREATE DATABASE first_database;
That’s the end of a query. I don’t know what the start of it is from the picture, but it’s like you writing
postgres=> SELECT * FROM my_table
postgres-> CREATE DATABASE first_database;
That’s a single query split across two lines, but it’s not valid SQL. So it errors. But
postgres=> CREATE DATABASE first_database;
That’s a single query on a single line, works totally fine.