<blockquote>
  <p>What is the default user of postgresql?</p>
</blockquote>

<p>postgres</p>

<blockquote>
  <p>How does hardcoding the postgres user improve security?</p>
</blockquote>

<p>It's not using the root user. </p>

<p>You c<em>an</em> use any account you like, but consistency is a Wonderful Thing, especially when you have lots [and lots] of Postgres clusters to manage. </p>

<blockquote>
  <p>What special rights does the postgres user have?</p>
</blockquote>

<p>Not many. </p>

<p>It installs itself a hole through the local firewall but, otherwise, it's just another user. </p>

<blockquote>
  <p>What is the upside and downside of using an unprivileged user ?</p>
</blockquote>

<p>You should <strong>never</strong> run applications (or databases) as root (unless they <em>actually</em> need to be). </p>

<p><em>Always</em> keep the biggest and best tools in the toolbox for <em>yourself</em>, ready to sort out the mess that Applications (or Users) make.  If you run stuff as root and it decides to do something really stupid to your machine, <em>you</em> may not be able to fix it. </p>

CC BY-SA 4.0
2019-05-05T19:55:28.887Z
It's not using the root user.

You can use any account you like, but consistency is a Wonderful Thing, especially when you have lots [and lots] of Postgres clusters to manage.     What do you mean here with "consistency is a Wonderful Thing" ?
omar amine
CC BY-SA 4.0
2019-05-08T07:51:25.420Z
Quite simply, when you get called into a "mess" at 2am, you don't want to guessing about /anything/, not even which user account the Postgres cluster is installed under.  If they're all the same?  No guessing required.  
Same goes for the file system layout you use when you build each machine - data goes /here/, transaction logs go /there/, archived WAL files go /there/; again, no guesswork.
Phill  W.
CC BY-SA 4.0
2019-05-03T10:06:22.210Z
2019-05-03T10:06:22.210Z
Phill  W.
<p>I am using a postgres docker image configured with the following environment:</p>

<pre><code>    image: healthcheck/postgres:alpine
    environment:
      POSTGRES_USER: postgres
</code></pre>

<p>I have the following questions regarding this setup:</p>

<ul>
<li>What is the default user of postgresql?</li>
<li>How does hardcoding the postgres user improve security?</li>
<li>What special rights does the postgres user have?</li>
<li>What is the upside and downside of using an unprivileged user ?</li>
</ul>

CC BY-SA 4.0
2019-05-02T12:52:57.593Z
@Zeitounator merci !!
omar amine
<postgresql>
Which system user should I use to run Postgres?
omar amine
# Which system user should I use to run Postgres?

(Asked by: username_0 on 2019-05-02)

I am using a postgres docker image configured with the following environment:
    image: healthcheck/postgres:alpine
    environment:
      POSTGRES_USER: postgres

I have the following questions regarding this setup:

What is the default user of postgresql?
How does hardcoding the postgres user improve security?
What special rights does the postgres user have?
What is the upside and downside of using an unprivileged user ?

**Tags:** postgresql

> **Comments:**
> **username_0**: @Zeitounator merci !!  

---

## 1 answers

### Answer by username_1 on 2019-05-03. Score: 1

> What is the default user of postgresql?

postgres

> How does hardcoding the postgres user improve security?

It's not using the root user.

You c*an* use any account you like, but consistency is a Wonderful Thing, especially when you have lots [and lots] of Postgres clusters to manage.

> What special rights does the postgres user have?

Not many.

It installs itself a hole through the local firewall but, otherwise, it's just another user.

> What is the upside and downside of using an unprivileged user ?

You should **never** run applications (or databases) as root (unless they *actually* need to be).

*Always* keep the biggest and best tools in the toolbox for *yourself*, ready to sort out the mess that Applications (or Users) make. If you run stuff as root and it decides to do something really stupid to your machine, *you* may not be able to fix it.

> **Comments:**
> **username_0**: It's not using the root user.  You can use any account you like, but consistency is a Wonderful Thing, especially when you have lots [and lots] of Postgres clusters to manage.     What do you mean here with "consistency is a Wonderful Thing" ?  
> **username_1**: Quite simply, when you get called into a "mess" at 2am, you don't want to guessing about /anything/, not even which user account the Postgres cluster is installed under.  If they're all the same?  No guessing required.   Same goes for the file system layout you use when you build each machine - data goes /here/, transaction logs go /there/, archived WAL files go /there/; again, no guesswork.  

---

