I was getting this error when debugging a resent NestJS application. All of my Google searched turned up nothing. After a bit of poking around in pgAdmin I found that there was a duplicate record under the sequences directory.
I was getting the following error:
QueryFailedError: relation 'car_id_seq' already exists.
I found two records, one for ‘car_id_seq’ and one for ‘car_id_seq1’. The only thing that I can imagine is that somewhere along the way that duplicate record (car_id_seq1) was entered and even though I dropped the car table, when NextJS restarted their was a conflict.
So, if you get a similar error, check your sequences list to remove any duplicates. Hopefully this saves someone some time 😀