If you get the below relation error it probably means you have spelled the table name wrong in a select statement. I was going through multiple tables tonight in a PostgreSQL database attempting to check a certain ID on a per table basis and I came across a table that provided the below error.
ERROR: relation “device_kits” does not exist
- dbname=# select count(*) from device_kits where device_id = '1606';
- ERROR: relation "device_kits" does not exist
I thought for sure I had the table name correct however after looking over the schema I realized that I had typed it incorrectly by leaving off an “s” after device. The table name was actually devices_kits under PostgreSQL. Below is the same command issued with the proper table name.
Proper Select Statement And Results:
- dbname=# select count(*) from devices_kits where device_id = '1606';
- (1 row)
See if you type the proper table name it really does work! Sometimes the most silly mistakes are the ones that can trip you up.