Session Parameters
Session Parameters
Section titled “Session Parameters”Session-level configuration with SET/SHOW.
SET variable = value; -- session-scopedSET LOCAL variable = value; -- transaction-scopedSHOW variable;SHOW ALL; -- list all parametersRESET variable;RESET ALL;
-- FunctionsSELECT current_setting('variable_name');SELECT set_config('variable_name', 'value', false);SHOW ALL lists every parameter this server recognises, with its current value and, where one
exists, a description. It is not a check for whether a name is real, though — once a session has
SET an unrecognised name, SHOW ALL reports that name too. Query pg_settings when you need the
recognised-only list — see the caution below on misspelled names.
PostgreSQL-Compatible Parameters
Section titled “PostgreSQL-Compatible Parameters”| Parameter | Default | Mutable | Description |
|---|---|---|---|
application_name | '' | Yes | Application name for the session |
bytea_output | hex | Yes | Output format for bytea values |
client_encoding | UTF8 | No | Client-side character encoding. A SET is accepted, but UTF8 (any case) is the only value it will take — see the note after this table |
client_min_messages | notice | Yes | Minimum message severity sent to client |
datestyle | ISO, MDY | No | Date display format. A SET is accepted, but only for ISO, MDY or the bare ISO — see the note after this table |
default_transaction_isolation | read committed | Yes | Default isolation level for subsequent transactions. serializable is accepted but downgraded to repeatable read — over the wire protocol with WARNING 01000, over the HTTP SQL API silently. See Transactions |
default_transaction_read_only | off | Yes | Default read-only state for new transactions; writes are rejected with SQLSTATE 25006 — see Transactions |
extra_float_digits | 1 | Yes | Accepted and echoed by SHOW, but inert — float output is always shortest-round-trip. Out-of-range values are accepted too, where PostgreSQL limits it to -15 .. 3 |
search_path | "$user", public | Yes | Schema search order. "$user" is reported literally, quotes included, and is not expanded to the current role — see the note after this table |
server_encoding | UTF8 | No | Server-side character encoding |
server_version | 17.0 | No | Reported PostgreSQL version |
standard_conforming_strings | on | No | Treat backslashes literally in strings. SET standard_conforming_strings = off is rejected — the parser always treats backslashes literally |
statement_timeout | 43200000ms (12 h) | Yes | Query timeout; PostgreSQL’s default is 0 (no limit). For a role that is not a superuser, SET statement_timeout to 0 or above 12 h fails with 42501; a superuser such as admin can set either. Over the HTTP SQL API a request returns Error 504 after about 15 seconds whatever the setting |
timezone | UTC | Yes | Session timezone. Governs wire output and to_char(), but not text casts — see the note after this table |
transaction_isolation | read committed | Yes | Current transaction isolation level |
lock_timeout | 0 | Yes | Lock acquisition timeout |
password_encryption | scram-sha-256 | No | Password hashing algorithm. A SET is accepted, but scram-sha-256 (any case) is the only value it will take — see the note after this table |
max_identifier_length | 63 | No | Reported maximum identifier length. DB9 does not apply it: a longer table or column name is stored in full and must be referenced in full, where PostgreSQL truncates it to 63 bytes with a NOTICE |
lc_messages | C | Yes | Locale for messages |
Mutable: No covers two different refusals, and the error tells you which one you hit. A parameter
that reports fixed server state rejects every value, including the one it already holds:
SET server_encoding = 'LATIN1';-- ERROR: parameter "server_encoding" cannot be changed (55P02)server_version and max_identifier_length behave the same way. client_encoding, datestyle,
standard_conforming_strings and password_encryption are different: the SET path works, and
succeeds for the value the parameter already holds, but every other value is refused:
SET client_encoding = 'UTF8'; -- SET (also 'utf8')SET client_encoding = 'LATIN1';-- ERROR: unsupported client_encoding 'LATIN1'; only UTF8 is supported (0A000)
SET datestyle = 'ISO, MDY'; -- SET (also 'ISO', any case)SET datestyle = 'SQL, MDY';-- ERROR: invalid value for parameter "datestyle": "SQL, MDY" (22023)
SET standard_conforming_strings = on; -- SETSET standard_conforming_strings = off;-- ERROR: standard_conforming_strings = off is not supported; the parser always treats backslashes literally (0A000)
SET password_encryption = 'scram-sha-256'; -- SETSET password_encryption = 'md5';-- ERROR: only password_encryption = scram-sha-256 is supported (0A000)PostgreSQL accepts SET client_encoding = 'LATIN1', every datestyle spelling, and
password_encryption = 'md5'. DB9 stores and serves text as UTF-8 and emits ISO dates, and
holding those two decisions constant is what lets it skip per-connection encoding conversion and
date-format state altogether — the cost is that a client which wants another encoding has to
convert on its own side. A driver that emits SET client_encoding = 'UTF8' on connect, or a
pg_dump script that emits it in its preamble, passes through unchanged.
search_path is mutable, but "$user" is not a substitution — DB9 stores and reports the token
literally and never resolves it to the current role:
SELECT current_user; -- adminSET search_path = "$user";SHOW search_path; -- "$user"SELECT * FROM my_table; -- ERROR: relation "my_table" does not exist (42P01) -- even when admin.my_table existsSET search_path = admin; -- name the schema and it resolvesSo name the schema you mean. "$user" is skipped rather than resolved, and what that leaves behind
depends on what sits beside it:
SET search_path = "$user"; -- only entry: lookup still finds publicSET search_path = "$user", app; -- resolves app, and no longer publicSET search_path = no_such_schema; -- resolves nothing; not a fallback case"$user" alone is the trap worth knowing: it looks like it scopes queries to your own schema, and
on a default database — where everything lives in public — every query keeps working, against
public. Pairing it with anything else — a real schema, or a name that does not exist — is what silently
drops public out of the path.
Other accepted PostgreSQL parameters: default_table_access_method, default_tablespace, default_text_search_config (default simple, where PostgreSQL ships english), default_transaction_deferrable, idle_in_transaction_session_timeout (default 300000ms, and enforced — a connection left idle inside a transaction for five minutes is dropped with FATAL: terminating connection due to idle-in-transaction timeout, as in PostgreSQL), in_hot_standby, integer_datetimes, intervalstyle, lc_monetary, lc_numeric, lc_time, log_min_messages (default warning), max_index_keys, row_security, xmloption.
Over the PostgreSQL wire protocol, SHOW ALL additionally lists the connection’s JWT claims as
request.jwt.claim.* (plus the whole payload as request.jwt.claims) and the caller’s subject as
auth.uid. These are per-connection values rather than server parameters, and they are absent
over the HTTP SQL API, where current_setting('auth.uid', true) returns NULL. See
Row-Level Security for how policies read them.
Also readable with SHOW, reporting server state rather than a session preference:
is_superuser, listen_addresses, max_connections (1000), port (5432), role,
server_version_num (170000), session_authorization, transaction_deferrable, and
transaction_read_only.
Three parameters are accepted but inert: work_mem (4MB), check_function_bodies (on) and
extra_float_digits (1). A SET
succeeds and SHOW reports the value you just set, but none of them changes any behaviour. (db9.use_optimizer
below is inert in a different way — it keeps reporting on whatever you set it to, so unlike these three
it does not even echo the write back.) For sort memory the parameter that does take effect is
db9.max_sort_bytes:
SET work_mem = '64MB'; -- accepted; SHOW returns 64MB; changes nothingSET db9.max_sort_bytes = 1048576; -- this is the real knob (default 134217728)See sort memory limits.
check_function_bodies has nothing to switch off: DB9 does not validate a LANGUAGE sql function
body at CREATE FUNCTION time under either setting. A body that cannot parse is stored, and fails
only when the function is first called, so test every function you create:
CREATE FUNCTION broken() RETURNS int AS $$ this is not valid sql $$ LANGUAGE sql;-- CREATE FUNCTION (accepted with check_function_bodies both on and off)
SELECT broken();-- ERROR: syntax error at or near "this" (42601)PostgreSQL rejects that CREATE FUNCTION outright when check_function_bodies is on.
LANGUAGE plpgsql bodies are checked for block structure and for the types named in declarations,
but not for the SQL inside them. A missing BEGIN, an IF without END IF, an assignment with no expression, or a
misspelled RAISE level is rejected at CREATE FUNCTION with 42601 (for example
PL/pgSQL function must have BEGIN block), and a DECLARE of an unknown type with 42704; in
either case the function is not created. The SQL statements inside the block are not checked, so
the same advice applies:
CREATE FUNCTION broken_pl() RETURNS int AS $$ BEGIN SELEC 1; RETURN 1; END $$ LANGUAGE plpgsql;-- CREATE FUNCTION
SELECT broken_pl();-- ERROR: syntax error at or near "SELEC" (42601)PostgreSQL rejects that CREATE FUNCTION too.
DB9-Specific Parameters
Section titled “DB9-Specific Parameters”| Parameter | Default | Description |
|---|---|---|
db9.hash_join_work_mem | 67108864 (64 MB) | Memory limit for the hash join build side (0 = unlimited) |
db9.dml_table_scan_max_rows | 10000 | Max rows per auxiliary source and combined cross-product cap for UPDATE FROM / DELETE USING (0 = unlimited) — see the note below |
db9.max_sort_bytes | 134217728 (128 MB) | Memory limit for sort operations |
db9.prepared_plan_cache_size | 128 | Prepared statement plan cache size |
db9.prepared_plan_cache_min_exec | 5 | Min executions before plan cache promotion |
db9.retry_max_attempts | 64 | Max retry attempts for autocommit DML/DDL on write conflict |
db9.retry_timeout | 0 | Max wall-time for retries per statement (0 = no limit) |
db9.use_optimizer | on | Cost-based optimizer (always on; SET ... = off is accepted but is a no-op) |
db9.password_grace_seconds | 0 | Grace period in seconds during which the old password still works after ALTER ROLE ... WITH PASSWORD (0 = immediate replacement) |
db9.enable_cop_pushdown | off | Enable coprocessor pushdown planning |
db9.sequence_windows | off | Draw CACHE 1 sequence values — including those of SERIAL and identity columns, but not of CYCLE sequences — from per-server-process windows. Set per database with ALTER DATABASE only — see the note below |
Embedding Parameters
Section titled “Embedding Parameters”| Parameter | Default | Description |
|---|---|---|
embedding.provider | platform-provided | Embedding provider: openai or bedrock (session override) |
embedding.endpoint | platform-provided | Embedding service endpoint URL (session override) |
embedding.model | platform-provided | Model name |
embedding.api_key | platform-provided, redacted as **** | Embedding service API key (session override) |
embedding.dimensions | platform-provided | Output vector dimensions |
embedding.concurrency | 5 | Max concurrent embedding calls |
embedding.max_calls | 100 | Max embedding calls per statement |
Every embedding.* parameter already has a working value on a new database — the built-in
embedding service needs no configuration. Setting them overrides the platform default for the
session. Read the live values with SHOW embedding.provider / SHOW embedding.model rather than
assuming they are unset; embedding.api_key always reads back as ****.
Vector Index Parameters
Section titled “Vector Index Parameters”| Parameter | Default | Description |
|---|---|---|
hnsw.ef_search | 40 | Dynamic candidate list size for HNSW index search. Accepted range 1-1000 inclusive; 0 or a value above 1000 fails with 22023 rather than clamping. A bare negative literal is a parser-level error instead — SET hnsw.ef_search = -1 gives 0A000 internal error, while the quoted '-1' gives the expected 22023. This is not specific to this parameter: SET <any name> = -1 fails the same way, including a name that does not exist |