title: PostgreSQL server fails to start on ArchLinux: FATAL: could not create lockfile »/run/postgresql/.s.PGSQL.5432.lock«
body: <p>I am quite new in Arch and a total beginner in PostgreSQL, so this may be a very basic question. </p>
  
  <p>I installed postgresql 11.5-4 from extra and pgadmin 4 from AUR, both seem to be running well.
  I created a test DB with the following command:</p>
  
  <pre><code>initdb -D /home/lg/test-db
  </code></pre>
  
  <p>I got the answer:</p>
  
  <pre><code>You can start the db-server using:
  pg_ctl -D /home/lg/test-db -l logdatei start
  </code></pre>
  
  <p>I tried that and got:</p>
  
  <pre><code>pg_ctl -D /home/lg/test-db -l logdatei start
  waiting for serer to start.... stopped 
  pg_ctl: could not start the server
  check the log.
  </code></pre>
  
  <p>The log only says that the lockfile  »/run/postgresql/.s.PGSQL.5432.lock« could not be created, because the folder could not be found. Under /run is no folder called "postgresql". I suppose postgresql can not create this folder, because it does not have the permission. Several posts online posts suggest to change the user/owner of the db to sudo, however. Postgresql prevents this, however. When I try any command as sudo, postgresql tells me that this command can't be run as root. There must be some very basic error in my thinking here, but I have not worked it out for 3 hours.</p>