From 3292fce732bc1dff9647c2cad9aba2e7b6bfb9f4 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Tue, 7 Apr 2020 14:37:40 -0500 Subject: [PATCH] Update schema reloading section Fixes https://github.com/PostgREST/postgrest-docs/issues/243 --- admin.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/admin.rst b/admin.rst index a192b304b..17486b155 100644 --- a/admin.rst +++ b/admin.rst @@ -187,12 +187,28 @@ Schema Reloading Users are often confused by PostgREST's database schema cache. It is present because detecting foreign key relationships between tables (including how those relationships pass through views) is necessary, but costly. API requests consult the schema cache as part of :ref:`resource_embedding`. However if the schema changes while the server is running it results in a stale cache and leads to errors claiming that no relations are detected between tables. +.. important:: + + Since v5.0, PostgREST also makes use of the schema cache for stored functions metadata: parameters, return type, volatility. + It also uses the schema cache for resolving overloaded functions. You should refresh the cache if a change in any of the prior is done. + To refresh the cache without restarting the PostgREST server, send the server process a SIGUSR1 signal: .. code:: bash killall -SIGUSR1 postgrest +.. note:: + + To refresh the cache in docker: + + .. code:: bash + + docker kill -s SIGUSR1 + + # or in docker-compose + docker-compose kill -s SIGUSR1 + The above is the manual way to do it. To automate the schema reloads, use a database trigger like this: .. code-block:: postgresql