0

Something weird is happening with pg on this particular Rails project im working on, I turned on the server after running some migrations and out of the blue pg stopped working.

StandardError (An error has occurred, this and all later migrations canceled:
An error has occurred, this and all later migrations canceled: PG::UndefinedTable: ERROR: relation "links" does not exist

Something really important to keep in mind is the fact that ive been working with the links table way before this error occurs.

Any tip would be appreciated and I can provide any other information you may need

diego
  • 409
  • 4
  • 12
  • Obviously something changed in one of the migrations, so that would be the place to start looking. At a guess the table name in the database is upper or mixed case and its name in the migration is not properly quoted to catch that, so the migration code is looking for a lower case version of the name. – Adrian Klaver Jul 19 '21 at 15:11
  • @AdrianKlaver none of the migrations, the problem started appearing after I left the postgres server running and the computer shut down incorrectly. I tried stopping postgres and starting again but the same issue appears – diego Jul 19 '21 at 15:59
  • You could try to restart the postgres service. Or try soemthing form this? https://stackoverflow.com/questions/5108876/kill-a-postgresql-session-connection – Int'l Man Of Coding Mystery Jul 19 '21 at 16:26
  • I'm not following, you said 'I turned on the server after running some migrations...' which to me means migrations where run. Also the error message says, 'An error has occurred, this and all later migrations canceled: ...', which again points at a migration as the culprit. – Adrian Klaver Jul 19 '21 at 17:53

0 Answers0