# Orthanc Container: Unable to Connect to Specified PostgreSQL Database

**URL:** https://discourse.orthanc-server.org/t/orthanc-container-unable-to-connect-to-specified-postgresql-database/5471
**Category:** General
**Created:** [January 25, 2025, 10:12am UTC](https://discourse.orthanc-server.org/t/orthanc-container-unable-to-connect-to-specified-postgresql-database/5471 "2025-01-25T10:12:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mulani](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/m/9dc877/32.png) [@mulani](https://discourse.orthanc-server.org/u/mulani)
#### Post date: [January 25, 2025, 10:12am UTC](https://discourse.orthanc-server.org/t/orthanc-container-unable-to-connect-to-specified-postgresql-database/5471/1 "2025-01-25T10:12:57Z")

</div>

I am attempting to launch Orthanc inside a container while connecting it to a PostgreSQL database. However, despite passing the ORTHANC\_\_POSTGRESQL\_\_DATABASE environment variable with a valid database name, Orthanc continues to attempt to connect to the default public schema.

This results in the following error:  
ERROR: permission denied for schema public

How can I configure Orthanc to connect to the specified database and avoid it defaulting to the public schema?

Any assistance on resolving this issue would be greatly appreciated.

---

<div class="post-metadata">

### Author: ![bcrickboom](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/b/e274bd/32.png) [@bcrickboom](https://discourse.orthanc-server.org/u/bcrickboom)
#### Post date: [January 27, 2025, 8:25am UTC](https://discourse.orthanc-server.org/t/orthanc-container-unable-to-connect-to-specified-postgresql-database/5471/2 "2025-01-27T08:25:39Z")

</div>

Please share your compose/config file and the logs.  
You could also have a look here and compare with your setup:

> <https://github.com/orthanc-server/orthanc-setup-samples/blob/master/docker/postgresql/docker-compose.yml>

Regards,

---

<div class="post-metadata">

### Author: ![alainmazy](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/alainmazy/32/1576_2.png) [@alainmazy](https://discourse.orthanc-server.org/u/alainmazy)
#### Post date: [January 29, 2025, 11:43am UTC](https://discourse.orthanc-server.org/t/orthanc-container-unable-to-connect-to-specified-postgresql-database/5471/3 "2025-01-29T11:43:36Z")

</div>

> [@mulani](#):
>
> How can I configure Orthanc to connect to the specified database and avoid it defaulting to the public schema?

Well, this is currently not possible. I have added it in our TODO.
