Thank you very much @freol!
I tried your custom component today and so far everything seems to work.
Maybe one more clue. For the initial setup of the postgis extension the postgres superuser is apparently needed. Otherwise you get the following error message:
Protokolldetails ( ERROR )
Mon Dec 23 2019 08:44:26 GMT+0100 (Mitteleuropäische Normalzeit)
Error during connection setup: (psycopg2.errors.InsufficientPrivilege) permission denied to create extension "postgis"
HINT: Must be superuser to create this extension.
[SQL: CREATE EXTENSION IF NOT EXISTS postgis CASCADE]
(Background on this error at: http://sqlalche.me/e/f405) (retrying in 3 seconds)
After that you can switch back to the actual homeassistant user for postgres