0

I have this database triviaDB that i am connecting to from a flask-sqlalchemy 'postgresql://devuser:devpass@localhost:5432/triviaDB'however it's giving me a programing error psycopg2: auth not allowed.

so i use the following commands in psql to try and give devuser authorization on this database but here is the problem when i run GRANT ALL PRIVILEGES ON DATABASE triviaDB to devuser; iget this error: ERROR: database "triviadb" does not exist when i quote the db name GRANT ALL PRIVILEGES ON DATABASE 'triviaDB' TO devuser; i get this : ERROR: syntax error at or near "'triviaDB'"

2
  • seems you need to get rid of the quotes around triviaDB Commented Apr 12, 2020 at 22:15
  • yeah but then i get an error database doesnt exist(first one in the post), i can connect with postgres user ni problems. Commented Apr 12, 2020 at 22:19

1 Answer 1

1

If the DB name was created with upper cases, you need to use double quotes:

GRANT ALL PRIVILEGES ON DATABASE "triviaDB" to devuser;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.