I'm new to postgresql and I can't seem to get it to drop a table.
db_dev=# \dt
List of relations
Schema | Name | Type | Owner
--------+-------------+-------+-------
public | DataSources | table | ted
public | Emails | table | ted
public | Users | table | ted
(3 rows)
When I try to delete the users table it gives an error:
db_dev=# drop table Users;
ERROR: table "users" does not exist
What am I doing wrong?
The problem is that your Users table is mixed case (and object names in Postgres are case sensitive). Without quotes around the table name Postgres will case fold the supplied name to "users"-- which doesn't exist. Your solution of quoting the table name works, not because users is a reserved name but because, by quoting it, you are telling Postgres to drop the "Users" table rather than the "users" table.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With