2

I am getting a "database does not exist error", even when the database exists:

postgres=# GRANT ALL PRIVILEGES ON DATABASE Owino to OdooD;

ERROR: database "owino" does not exist

Name    |  Owner   | Encoding |   Collate   |    Ctype    |    Access privileges

Owino   | dominus  | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
postgres| postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres           +
        |          |          |             |             | postgres=CTc/postgres  +
        |          |          |             |             | orokon=CTc/postgres    +
        |          |          |             |             | powerbidev=CTc/postgres+
        |          |          |             |             | odoodev=CTc/postgres
9

The database was created with double quotes, so the name is now case-sensitive and you are now stuck with the dreaded quoted identifiers. "Owino" is a different name than Owino

GRANT ALL PRIVILEGES ON DATABASE "Owino" to OdooD;

Depending on how you created the user, you might need to use the dreaded double quotes for the user name as well ("OdooD").

I highly recommend to simply never use double quotes in SQL.

See the manual for more details:
https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS

|improve this answer|||||
-3

Dont use mixed case database names, there are several applications that will have problems with this

Owino is mixed case

The answer above imples that you created the database name using " ".

I have encountered this issue when I created a database name without " ", just using a mixed case name like MyDatabase

|improve this answer|||||
  • 2
    What does this add to the other answer? – Evan Carroll Sep 12 '17 at 1:45
  • 1
    The advice is good, but it is indeed not an answer to the problem presented. – a_horse_with_no_name Sep 12 '17 at 6:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.