N8n Docker → PostgreSQL: “permission denied for database” although manual connection works

Unable to use Postgres superuser due to company policy

I also want to add an important detail:

Due to company security restrictions, I am not allowed to use any PostgreSQL superuser (e.g., postgres).
The only account I’m allowed to use is mgr, which has:

  • CONNECT privilege on the database

  • CREATE / ALTER TABLE privileges

  • Ability to create tables inside the target schema (public)

But cannot:

  • Become owner of the database

  • Create extensions

  • Perform superuser-level operations

Therefore:

:check_mark: Manual connection using mgr works fine and I can CREATE TABLE

:cross_mark: But n8n still fails at startup with:

permission denied for database VN8N

Since I cannot use superuser privileges, I want to clarify:

  1. Does n8n require superuser-level privileges during initialization?

  2. Is there an official list of the minimal required privileges?

  3. Can n8n run normally without superuser privileges in PostgreSQL?

  4. Does n8n attempt any operations at startup that require superuser privileges?

Any guidance or recommendations would be greatly appreciated.

DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=correct-host
DB_POSTGRESDB_PORT=5432
DB_POSTGRESDB_DATABASE=VN8N
DB_POSTGRESDB_SCHEMA=mgr
DB_POSTGRESDB_USER=mgr
DB_POSTGRESDB_PASSWORD=******

Last session crashed
Initializing n8n process
There was an error initializing
DB permission denied for database VN8N

I think that mgr must have sufficient privileges on the VN8N database itself, not just the ability to CREATE TABLE when you connect manually…

So this extra command should give the db access to the schema:

GRANT ALL PRIVILEGES ON DATABASE “VN8N” TO mgr;

If I understood well your point… let me know.

Cheers!