Create Database command not working

  1. What am I doing wrong? Why its not working?

  2. Is there a way to copy past into the terminal this advice doesnt work:
    💡 [SOLUTION] for error: `Unable to read from browser's clipboard`

I dont have insert key on my computer, ive given the site permissions but it doesnt work:

image

  1. Is there a way to make the code result preview window into a seperate screen to get more real estate/ visibility on the screen (similar to codesandbox) ?

  2. Now the
    postgres=> \l
    command is not working either

edit: Neither of these commands are doing anything either:

image

this is not working either:

There are a couple of things.

1. Clipboard error: Try a right-click + copy/paste. You can try Ctrl+c/Ctrl+v as well. That should work.
2. The command \l is showing the correct output as you shared in the screenshot.
3. Command error: The commands (except \l, \d, \c )should end with a semicolon ; like this: CREATE DATABASE students;

Nope does not work

  1. The command \l is showing the correct output as you shared in the screenshot.

Negative, the first time it did that, yet all other subsequent times it does not, it just goes to the next line and does not show any databases

Nope. when i do that with a semicolon it shows a syntax error. When I do it without a semicolon it just goes to the next line

I would expect one of these to pass the challenge, ive tried both ways:

here are the instructions, I would expect one of the above commands I tried to pass the challenge

what I am doing wrong?

image

If thats the case I would expect those commands to pass the challege, I had to restart and close the browser a bunch of times to get the CREATE DATABASE command to work, and now why cant I create a table or if its being created why is it not passing the challenge?

Hey @kravmaguy, here’s some things I see…

commands not working:

The main problem I think I see with your commands not working is that you are often forgetting the semi-colon. If you hit enter without a complete command, you can continue the command on the next line…
Screen Shot 2022-06-30 at 8.24.33 AM
Here, you entered CREATE TABLE students() and pressed enter. There was no semi-colon so you are basically continuing that command on the next line. You can see the prompt changed from => to ->. When you see a prompt that isn’t =>, that means you are in the middle of a command. You continued the command by entering what’s on the second line - and third line. On the third line you have the semi-colon so it thinks you are now finished with the command - but it tried to execute all of those lines, e.g. CREATE TABLE students() CREATE TABLE students CREATE TABLE students();, as one command. That’s why it’s failing. When you see the -> prompt you can just enter a semi-colon to complete whatever command you are in the middle of and start a new command on the next prompt. I know the prompt doesn’t always show up - just hit enter to make it visible.

copy/pasting:

I don’t know if I can help you with the copy/pasting issue. The only thing I can mention is that CodeAlly hosts the VM’s, so you may need to allow their domain access to the clipboard. It would be https://app.codeally.io - I would give that a try and let us know if it works. Then we can maybe help others who have had a similar issue.

screen real estate

You can’t move the CodeRoad window outside of vscode, but there’s a few things you can do to get “more” real estate. I zoom my browser out to 80% - that helps a lot. You could make your browser full screen. You can close/open the file explorer on the left by clicking the icon that looks like two pieces of paper near the top left. You can change the layout of things in a number of ways, but if you right click the terminal bar or whatever, you can make it so the two windows you see are side-by-side:
Screen Shot 2022-06-30 at 8.47.35 AM
^ Right click “TERMINAL”, click “Move Panel Right” to make the windows side-by-side

1 Like

I tried it didnt work, I went to their website and did it:

image

its the same behavior as before, like im able to copy paste everywhere without a problem except in the terminal (which is where i really want it to work)

what your saying makes sense I also thought that the command is continuing like one long sentence and the semicolon is what ends it. however can we just clarify one thing:

my understanding of the above instruction is that all commands Except \l , \d, \c should end with a semi colon.

can you please go over one more time that this is correct behavior around 1:55 of the video :

I am expecting any successful commands to also clear the cache (command) yet it does not, so I guess that is my mistake, so even though this command is correct and even though there was an output directly preceeding it(showing the tables)

There is still some leftover command in the cache from before it from when I did:

/l
\l

so it is important to note that even a successful output like im showing in the video e.g. listing the tables does not clear the cache and only the semicolon will do this.

Yes i had noticed that as well. My mistake was i was expecting that cache to clear as directly before it I had successfully printed out the databases yet the cache did not clear re:

postgres=> /l    (mistake that will still remain in cache)
postgress-> \l  (correct command)

Print out databases etc....

cache isnt cleared despite prinitng out databases 

so basically only a semicolon will clear the cache. Isnt that strange though? like why should I have to be in the middle of a command if Ive successfully did a print out… I guess thats just how it is…

I watched the video you shared and it seems like the command is still incomplete.

If you note that in the next line, the prompt is still postgres-> .

As mentioned in the solution below, you have to enter the commands when the prompt
is postgres=>

postgres-> means that you are in the middle of the command.

Note that / is a reserved Mathematical operator in postgres. So, when you enter the wrong command /l, the terminal is expecting you to complete the command.

Force stop commands

In case, you are confused and the commands don’t seem to work, you can force stop the commands midway using Ctrl+C. Now the prompt should be postgres=> and you would be able to run the commands.

1 Like