while setting up postgres on my computer, i learned that postgres/psql in the terminal does not behave like bash at all, it becomes a SQL editor, now you might laugh at this but… yeah just a new discovery for me. psql expects a ; at the end of the statement, if that is not put, it will keep listening for the statements, i think this is designed like this because… it needs indentation, which doesnt work in terminal. now i might be wrong so i asked gpt
You’re close, but the reason is slightly different.
The primary reason is not indentation. Terminals absolutely support multiline input.
The actual reason is: SQL statements are free-form and can span multiple lines, so PostgreSQL needs an explicit terminator to know when the statement ends.
So correction:
“psql keeps listening without `;` because SQL statements require an explicit terminator, not because terminals can’t handle indentation.”
i also did some tinkering around postgres
like \l lists the databases, \dt lists the tables \p for something related to buffer, \q for quitting.
after all this i began studying for the exams…
alright that’s it for the day, umm good start of a day but it went down by the evening after a nap lol… but hopelly its gonna improve, i will try to fix my focus.
Timeline