Psycopg2.programmingerror: Relation "matches" Does Not Exist
Solution 1:
"You probably already solved this on your own like I had to, however if you are still searching or for anyone else who may come across this thread. I am also taking this course and came across this beginner problem.
This was user error. I was connecting to vagrant and the tournament database in the wrong way.
After logging into vagrant I was in the right folder accessing the right database but in the wrong method.
Error:
Once in vagrant I went to psql as user vagrant and imported the file.
\i tournament.sql
Then I connected to the database.
\c tournament
Then I was exiting psql to run the file and getting the relation does not exist error.
I needed to do one more step.
FIX:
Once connected and logged into the database tournament. I needed to import the tournament.sql file again.
That created the relations within the actual database and not just vagrant or wherever I was creating them before.
so from Vagrant after the command Vagrant ssh # run these commands separately cd /vagrant/tournament/
psql
\i tournament.sql
\c tournament
\i tournament
#last check to verify your relations were created
\dt
\d (table or view)
That is what did it for me. The rest of the project was easy. I hope this helps anyone searching for the answer on here." My q&a
Post a Comment for "Psycopg2.programmingerror: Relation "matches" Does Not Exist"