0

I'm attempting to initialise my database for a flask app using flask-sqlalchemy.

I've received the following fatal error.

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "occ-appdc1001" (172.25.208.1), port 5432 failed: FATAL: permission denied to set parameter "log_statement_stats"

My connection string is:

app.config['SQLALCHEMY_DATABASE_URI'] = "postgresql://prodcent_user:XXXXX@SERVER:5432/appdata?options=-search_path=datamanager"

I've tried adding permissions as follows:

GRANT USAGE ON SCHEMA datamanager TO prodcent_user ;
GRANT USAGE ON SCHEMA datamanager TO prodcent_user ;

GRANT SELECT ON ALL TABLES IN SCHEMA datamanager TO prodcent_user ;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA datamanager TO prodcent_user ;
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA datamanager TO prodcent_user ;

GRANT ALL ON ALL TABLES IN SCHEMA datamanager TO prodcent_user ;
GRANT ALL ON ALL SEQUENCES IN SCHEMA datamanager TO prodcent_user ;
GRANT ALL ON ALL FUNCTIONS IN SCHEMA datamanager TO prodcent_user ;

But still have the same error.

1 Answer 1

1

Only the superuser can change log_statement_stats. It appears you are using prodcent_user, which probably doesn't have superuser privileges.

You can try either using a superuser or find a way to grant superuser privileges to prodcent_user

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.