pgjones / tozo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can't start tozo app with psql (v 15.1).

JavaPantry opened this issue · comments

can't start tozo app with psql (v 15.1).
Error message:
raise LifespanFailureError("startup", message["message"])
hypercorn.utils.LifespanFailureError: Lifespan failure in startup. 'permission denied for schema public'

According Article PostgreSQL v15 change permission rules

Had to downgrade PostgreSQL to v14.6 (server run succeed)

Any suggestion on how to modify migration (or model) files to run on PostgreSQL v 15.1?

The book was written before Postgres 15, so I'll need to investigate this. I'd recommend staying on Postgres 14 for now.

Sounds good! Thank you.

To resolve this I added the following to the end of recreate_db(), in backend/src/backend/run.py :

    call(  # nosec
        ["psql", "-U", "postgres", "-d", f"{db_url.path.removeprefix('/')}", "-c", f"GRANT ALL ON SCHEMA public TO {db_url.username}"],
    )

Thank you.

I've added this to the example code with 45a2468