Reads and applies the PostgREST response GUCs a function or trigger may set during a request:
response.headers— a JSON array of single-key objects, each becoming a response header. The same name may appear twice (e.g. twoSet-Cookie), so headers are emitted in order and never folded. A malformed value (anything but an array of single-key string-valued objects) isPGRST111.response.status— overrides the HTTP status. A non-integer / out-of-range value isPGRST112.
The GUCs are transaction-local (set_config(..., true) / SET LOCAL), so
read/1 must run on the SAME Postgrex transaction connection that executed the
function/mutation, before the transaction ends.
Summary
Functions
Apply parsed GUC headers to conn, preserving order and duplicates. The
status override (guc.status) is NOT applied here — the caller must pass it to
send_resp so it takes effect — use status/2 to fold it with the default.
Read the two response GUCs on transaction connection tx.
The effective status: the GUC override when present, else default.
Functions
Apply parsed GUC headers to conn, preserving order and duplicates. The
status override (guc.status) is NOT applied here — the caller must pass it to
send_resp so it takes effect — use status/2 to fold it with the default.
Read the two response GUCs on transaction connection tx.
Returns {:ok, %{headers: [{name, value}], status: integer | nil}} or
{:error, :bad_response_headers_guc} / {:error, :bad_response_status_guc}.
The effective status: the GUC override when present, else default.