# Custom postgresql schema

**URL:** <https://community.temporal.io/t/custom-postgresql-schema/18656>\
**Category:** Community Support\
**Tags:** postgresql\
**Created:** [November 12, 2025, 8:00pm UTC](https://community.temporal.io/t/custom-postgresql-schema/18656 "2025-11-12T20:00:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sprath](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/sprath/32/6551_2.png) [@sprath](https://community.temporal.io/u/sprath)\
**Post date:** [November 12, 2025, 8:00pm UTC](https://community.temporal.io/t/custom-postgresql-schema/18656/1 "2025-11-12T20:00:08Z")

</div>

I followed this example to setup a custom schema in the db:

> [@Setup custom schema and setup temporal specific in Postgres](https://community.temporal.io/t/setup-custom-schema-and-setup-temporal-specific-in-postgres/7226):
>
> Hi, I am trying to setup schema and update schema to a specific schema, not using the public schema. Please help out on the process on doing so as I had gone through certain threads but couldn’t find a proper working example to setup the specifics using the temporal sql tool? Tried out the following as well [https://github.com/temporalio/temporal/issues/3383#issue-1373532593](https://github.com/temporalio/temporal/issues/3383#issue-1373532593) - --ca flag seems to be missing. SQL\_DATABASE=temporal ./temporal-sql-tool --ca search\_path=temporal setup-schema -v 0.0…

> SQL\_DATABASE=temporal ./temporal-sql-tool --ca search\_path=temporal setup-schema -v 0.0  
> SQL\_DATABASE=temporal ./temporal-sql-tool --ca search\_path=temporal update -schema-dir schema/postgresql/v96/temporal/versioned
> 
> SQL\_DATABASE=temporalvisibility ./temporal-sql-tool --ca search\_path=temporal setup-schema -v 0.0  
> SQL\_DATABASE=temporalvisibility ./temporal-sql-tool --ca search\_path=temporal update -schema-dir schema/postgresql/v96/visibility/versioned

The database looks ok once the setup happens. When I try to launch, however, I get errors like this:

> temporal-postgresql | 2025-11-12 19:24:43.021 UTC [135] ERROR: relation “schema\_version” does not exist at character 26  
> temporal-postgresql | 2025-11-12 19:24:43.021 UTC [135] STATEMENT: SELECT curr\_version from schema\_version where version\_partition=0 and db\_name=$1

It works fine when using the public schema. Does anyone have any suggestions to get it to recognize the other schema? I don’t see an environment variable to specify a schema.
