Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Relation “users” does not exist. PostgreSQL

Tags:

postgresql

I have a users table, I see it in pgadmin4, but for some reason when I use psql and try to run list users, I get the following error:

Relation “users” does not exist.

like image 358
Snewman888 Avatar asked Jun 06 '26 12:06

Snewman888


2 Answers

This will happen if the psql user does not have schema level privileges. This error message can be misleading.

To solve this issue, try connecting using psql with an admin user and run:

1.

GRANT USAGE ON SCHEMA public TO <non-admin-user>;  
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO <non-admin-user>;
like image 57
sizzlecookie Avatar answered Jun 10 '26 19:06

sizzlecookie


You need to put table name in quotes. And, it is case sensitive:

SELECT * FROM "Users";
like image 41
Ahmet Emrebas Avatar answered Jun 10 '26 17:06

Ahmet Emrebas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!