# Postgres Privileges

**URL:** <https://community.n8n.io/t/postgres-privileges/6506>\
**Category:** Questions\
**Tags:** core\
**Created:** [June 28, 2021, 1:17pm UTC](https://community.n8n.io/t/postgres-privileges/6506 "2021-06-28T13:17:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![go4cas](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/go4cas/32/1260_2.png) [@go4cas](https://community.n8n.io/u/go4cas)\
**Post date:** [June 28, 2021, 1:17pm UTC](https://community.n8n.io/t/postgres-privileges/6506/1 "2021-06-28T13:17:46Z")

</div>

I have managed to start up an instance of n8n with config data stored in a Postgres DB. When I start this up with the `postgres` user (which has ALL privileges), the instance connects 100%. When I try to connect with a user with only `SELECT, INSERT, UPDATE, DELETE` privileges it does not work.

I then tried to first start up with the `postgres` user, after which the tables were correctly created, and then connect to the same DB (which now contains the n8n tables) with the limited user. But, still not connecting - I suspect this is because n8n, on startup ALWAYS runs the migrations.

I have 2 questions:  
(1) What are the exact permission required for the DB user?  
(2) Is there a way to start the instance without migrations?

---

<div class="post-metadata">

**Author:** ![harshil1712](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/harshil1712/32/1374_2.png) [@harshil1712](https://community.n8n.io/u/harshil1712)\
**Post date:** [June 30, 2021, 12:13pm UTC](https://community.n8n.io/t/postgres-privileges/6506/2 "2021-06-30T12:13:39Z")

</div>

Hey @go4cas!

Sorry, we missed the question. I don’t have much idea about this, but maybe @krynble can help you 🙂

---

<div class="post-metadata">

**Author:** ![krynble](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/krynble/32/2010_2.png) [@krynble](https://community.n8n.io/u/krynble)\
**Post date:** [June 30, 2021, 12:29pm UTC](https://community.n8n.io/t/postgres-privileges/6506/3 "2021-06-30T12:29:20Z")

</div>

Hey @go4cas

n8n will check if the migrations are up to date but shouldn’t reapply any of them.

In any case, with an up-to-date database you should be able to start it with basic privileges as you mentioned. Do you get any errors on your console? Or warnings?

Now to your questions:

1. Other than the ones you mentioned, I am sure we also need `CREATE`, `DROP` (for rolling back), and `ALTER`. Maybe under the hood TypeORM may use other properties but I am not entirely sure.
2. Unfortunately no. n8n always does this as an outdated database would render n8n unusable.

---

<div class="post-metadata">

**Author:** ![go4cas](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/go4cas/32/1260_2.png) [@go4cas](https://community.n8n.io/u/go4cas)\
**Post date:** [June 30, 2021, 2:48pm UTC](https://community.n8n.io/t/postgres-privileges/6506/4 "2021-06-30T14:48:43Z")

</div>

@krynble, thanks for the reply!

When using the user with `SELECT, INSERT, UPDATE, DELETE` permissions, I get the following error: “_Error: There was an error: permission denied for table webhook\_entity_”.

I have tried with both `npx` and running n8n inside a Docker container.

I totally get why n8n would run migrations at startup - makes perfect sense. I am just facing an issue where in our production setup, our DBA’s do not allow any permissions other than normal CRUD.

But, thanks for the feedback anyways.

---

<div class="post-metadata">

**Author:** ![krynble](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/krynble/32/2010_2.png) [@krynble](https://community.n8n.io/u/krynble)\
**Post date:** [June 30, 2021, 3:10pm UTC](https://community.n8n.io/t/postgres-privileges/6506/5 "2021-06-30T15:10:52Z")

</div>

That is strange.

Did n8n crash on startup or after? What action were you performing when it crashed? Were you trying to activate a workflow?

Also, maybe double checking the permissions (trying to connect with these credentials from another app or CLI) just to make sure the user has the correct permissions.

---

<div class="post-metadata">

**Author:** ![go4cas](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/go4cas/32/1260_2.png) [@go4cas](https://community.n8n.io/u/go4cas)\
**Post date:** [June 30, 2021, 4:42pm UTC](https://community.n8n.io/t/postgres-privileges/6506/6 "2021-06-30T16:42:54Z")

</div>

@krynble, it crashes on startup (both for `npx` and `Docker`).

I have connected successfully with the limited privilege user to my SQL client - I can then do `SELECT`, `INSERT`, etc on the n8n tables.
