Add db-prepared-statements config option

This commit is contained in:
laurenceisla
2021-07-23 11:41:47 -05:00
committed by GitHub
parent f5c5094d7d
commit 41325fd9ba
4 changed files with 33 additions and 0 deletions
+13
View File
@@ -120,6 +120,19 @@ The burst argument tells Nginx to start dropping requests if more than five queu
Nginx rate limiting is general and indiscriminate. To rate limit each authenticated request individually you will need to add logic in a :ref:`Custom Validation <custom_validation>` function.
.. _connection_poolers:
Using Connection Poolers
------------------------
In order to increase performance, PostgREST uses prepared statements by default. However, this setting is incompatible with connection poolers such as PgBouncer working in transaction pooling mode. In this case, you need to set the :ref:`db-prepared-statements` config option to ``false``. On the other hand, session pooling is fully compatible with PostgREST, while statement pooling is not compatible at all.
.. note::
If prepared statements are enabled, PostgREST will quit after detecting that transaction or statement pooling is being used.
You should also set the ``db-channel-enabled`` config option to ``false``, due to the ``LISTEN`` command not being compatible with transaction pooling, although it should not give any errors if it's left enabled by default.
Debugging
=========