docs: fix broken links older GUC settings
No longer links but embeds the old settings in a details html element.
This commit is contained in:
committed by
Wolfgang Walther
parent
2fc7ae77ed
commit
1bd530df3a
@@ -529,7 +529,7 @@ db-use-legacy-gucs
|
||||
**In-Database** pgrst.db_use_legacy_gucs
|
||||
=============== =================================
|
||||
|
||||
Determine if GUC request settings for headers, cookies and jwt claims use the `legacy names <https://postgrest.org/en/v8.0/api.html#accessing-request-headers-cookies-and-jwt-claims>`_ (string with dashes, invalid starting from PostgreSQL v14) with text values instead of the :ref:`new names <guc_req_headers_cookies_claims>` (string without dashes, valid on all PostgreSQL versions) with json values.
|
||||
Determine if GUC request settings for headers, cookies and jwt claims use the :ref:`legacy names <guc_legacy_names>` (string with dashes, invalid starting from PostgreSQL v14) with text values instead of the :ref:`new names <guc_req_headers_cookies_claims>` (string without dashes, valid on all PostgreSQL versions) with json values.
|
||||
|
||||
On PostgreSQL versions 14 and above, this parameter is ignored.
|
||||
|
||||
|
||||
@@ -140,7 +140,36 @@ PostgREST stores the headers, cookies and headers as JSON. To get them:
|
||||
Legacy settings
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
For PostgreSQL versions below 14, PostgREST will take into consideration the :ref:`db-use-legacy-gucs` config, which is set to true by default. This means that the interface for accessing these GUCs is `the same as in older versions <https://postgrest.org/en/v8.0/api.html#accessing-request-headers-cookies-and-jwt-claims>`_. You can opt in to use the JSON GUCs mentioned above by setting the ``db-use-legacy-gucs`` to false.
|
||||
For PostgreSQL versions below 14, PostgREST will take into consideration the :ref:`db-use-legacy-gucs` config, which is set to true by default.
|
||||
This means that the interface for accessing these GUCs is the same as in older versions (see below).
|
||||
You can opt in to use the JSON GUCs mentioned above by setting the ``db-use-legacy-gucs`` to false.
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>
|
||||
<details>
|
||||
<summary>Old GUCs</summary>
|
||||
|
||||
.. code-block:: postgresql
|
||||
|
||||
-- To read the value of the User-Agent request header:
|
||||
SELECT current_setting('request.header.user-agent', true);
|
||||
|
||||
-- To read the value of sessionId in a cookie:
|
||||
SELECT current_setting('request.cookie.sessionId', true);
|
||||
|
||||
-- To read the value of the email claim in a jwt:
|
||||
SELECT current_setting('request.jwt.claim.email', true);
|
||||
|
||||
.. note::
|
||||
|
||||
``request.jwt.claim.role`` defaults to the value of :ref:`db-anon-role`.
|
||||
|
||||
.. raw:: html
|
||||
|
||||
</details>
|
||||
</p>
|
||||
|
||||
|
||||
.. _guc_req_path_method:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user