Tell us what’s happening:
Describe your issue in detail here.
Hello when I try to execute the queries.sh file I get the error permission denied for table games please help
That’s the issue I can’t access the tables it keeps saying permission denied when I try to access the games table and also when I try to execute the queries.sh file
Were you ever able to access the tables from the terminal? Or has it always been like that ever since you created them?
Also, how did you create them? Try to remember what you did exactly.
I was able to create the tables and database and make the files executable but afterwards when I try to access the tables or to execute the queries.sh file I keep getting the error permission denied.
I am trying to understand if something changed in your environment or if this has always been a problem for you.
Please post the code or method you used to create the tables.
I’m new to this is there a way to access previous code as this is a project I’ve worked on for a quite a while every time starting the terminal again as to the method I used after logging in using freecodecamp as the username and postgres as the database name I created the database and the respective tables.
As to whether this has been a recurring problem so far I’ve not had a similar issue before here as previously I had worked on building a celestial bodies database a Mario Database and a student database succesfully without any issues.
Does this answer your question?
how did you confirm that you have the same output?
To make sure of it, you have to run the script and redirect the output to a file, then run a diff command against the output file and the expected_output.txt to see if there are any reported differences.
you can also redirect the output of the diff itself to a file if you want to share the output here
In your database dump, I see ALTER … OWNER TO postgres in a number of places - the tables and some of the other things are owned by postgres, not freecodecamp. The script uses freecodecamp so it can’t access the tables - and if you log in with freecodecamp in the terminal, you won’t be able to access them either it looks like. Perhaps you accidentally logged in with postgres and created the tables, not sure. But I changed all those OWNER TO postgres to OWNER TO freecodecamp in your database dump, rebuilt the database, and all the tests passed with your two scripts. That should work for you @DennisWainaina.
Or, if you want to have some more fun, you could log in the terminal with postgres (psql -U postgres) and figure out how to change the table owners through the terminal.