You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pgwire: update statusReportParams to match PostgreSQL 18
Add four new ParameterStatus parameters to match PostgreSQL 18's
connection startup sequence: default_transaction_read_only,
in_hot_standby, search_path, and scram_iterations.
in_hot_standby is a read-only session variable that always returns
"off" (CockroachDB does not support hot standby). scram_iterations
is a read-only session variable whose value comes from the
server.user_login.password_hashes.default_cost.scram_sha_256
cluster setting, so it reflects the actual configured SCRAM cost.
default_transaction_read_only and search_path are also added to
bufferableParamStatusUpdates so that clients receive ParameterStatus
updates when these values change mid-session. scram_iterations is
not included because it is backed by a cluster setting rather than
session data, so the session-data-diffing mechanism cannot detect
its changes.
Also increase the SQL proxy's authentication loop iteration limit
from 20 to 30 in `authenticate()` and `readTokenAuthResult()`. The
additional ParameterStatus messages pushed the total message count
past 20 when using SCRAM-SHA-256 authentication (4 auth messages +
16 ParameterStatus + 2 finalize = 22 > 20), causing the proxy to
drop password-authenticated connections with EOF.
Fixes#126493
Release note (sql change): CockroachDB now sends
default_transaction_read_only, in_hot_standby, search_path, and
scram_iterations as ParameterStatus messages during connection
startup, matching PostgreSQL 18 behavior.
Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
Copy file name to clipboardExpand all lines: docs/generated/sql/session_vars.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,6 +111,7 @@ SHOW application_name;
111
111
<tr><td><code>foreign_key_cascades_limit</code></td><td>Sets the maximum number of cascading operations for foreign key actions.</td><td><code>10000</code></td><td>No</td><td><code>sql.defaults.foreign_key_cascades_limit</code></td></tr>
112
112
<tr><td><code>idle_in_transaction_session_timeout</code></td><td>Sets the maximum allowed duration for an idle transaction session. The session is terminated if it exceeds this limit.</td><td><code>0s</code></td><td>No</td><td><code>sql.defaults.idle_in_transaction_session_timeout</code></td></tr>
113
113
<tr><td><code>idle_session_timeout</code></td><td>Sets the maximum allowed duration for an idle session. The session is terminated if it exceeds this limit.</td><td><code>0s</code></td><td>No</td><td><code>sql.defaults.idle_in_session_timeout</code></td></tr>
114
+
<tr><td><code>in_hot_standby</code></td><td>Reports whether the server is currently in hot standby mode (always off in CockroachDB).</td><td><code>off</code></td><td>Yes</td><td>-</td></tr>
114
115
<tr><td><code>index_join_streamer_batch_size</code></td><td>Sets the size limit on input rows to the ColIndexJoin operator when using the Streamer API for a single lookup KV batch.</td><td><code>8.0 MiB</code></td><td>No</td><td><code>sql.distsql.index_join_streamer.batch_size</code></td></tr>
115
116
<tr><td><code>index_recommendations_enabled</code></td><td>Controls whether index recommendations are enabled.</td><td><code>on</code></td><td>No</td><td>-</td></tr>
116
117
<tr><td><code>initial_retry_backoff_for_read_committed</code></td><td>Sets the initial backoff duration for automatic retries of statements in explicit READ COMMITTED transactions that encounter retry errors.</td><td><code>2ms</code></td><td>No</td><td>-</td></tr>
@@ -211,6 +212,7 @@ SHOW application_name;
211
212
<tr><td><code>results_buffer_size</code></td><td>Specifies the size at which the pgwire results buffer will self-flush.</td><td><code>-</code></td><td>Yes</td><td>-</td></tr>
212
213
<tr><td><code>role</code></td><td>The current role for the session.</td><td><code>none</code></td><td>No</td><td>-</td></tr>
213
214
<tr><td><code>row_security</code></td><td>Controls whether row level security is enabled.</td><td><code>on</code></td><td>No</td><td>-</td></tr>
215
+
<tr><td><code>scram_iterations</code></td><td>Reports the iteration count for SCRAM-SHA-256 password hashing.</td><td><code>10610</code></td><td>Yes</td><td>-</td></tr>
214
216
<tr><td><code>search_path</code></td><td>Sets the list of namespaces to search when resolving unqualified names.</td><td><code>"$user", public</code></td><td>No</td><td>-</td></tr>
215
217
<tr><td><code>serial_normalization</code></td><td>Controls how `SERIAL` columns are normalized.</td><td><code>rowid</code></td><td>No</td><td><code>sql.defaults.serial_normalization</code></td></tr>
216
218
<tr><td><code>server_encoding</code></td><td>Reports the database encoding (always UTF8). This cannot be changed.</td><td><code>UTF8</code></td><td>Yes</td><td>-</td></tr>
Copy file name to clipboardExpand all lines: pkg/sql/logictest/testdata/logic_test/show_source
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -121,6 +121,7 @@ force_savepoint_restart off
121
121
foreign_key_cascades_limit 10000 Sets the maximum number of cascading operations for foreign key actions.
122
122
idle_in_transaction_session_timeout 0 Sets the maximum allowed duration for an idle transaction session. The session is terminated if it exceeds this limit.
123
123
idle_session_timeout 0 Sets the maximum allowed duration for an idle session. The session is terminated if it exceeds this limit.
124
+
in_hot_standby off Reports whether the server is currently in hot standby mode (always off in CockroachDB).
124
125
index_join_streamer_batch_size 8.0 MiB Sets the size limit on input rows to the ColIndexJoin operator when using the Streamer API for a single lookup KV batch.
125
126
index_recommendations_enabled off Controls whether index recommendations are enabled.
126
127
initial_retry_backoff_for_read_committed 2 Sets the initial backoff duration for automatic retries of statements in explicit READ COMMITTED transactions that encounter retry errors.
@@ -218,6 +219,7 @@ require_explicit_primary_keys off
218
219
results_buffer_size 524288 Specifies the size at which the pgwire results buffer will self-flush.
219
220
role none The current role for the session.
220
221
row_security on Controls whether row level security is enabled.
222
+
scram_iterations 10610 Reports the iteration count for SCRAM-SHA-256 password hashing.
221
223
search_path "$user", public Sets the list of namespaces to search when resolving unqualified names.
222
224
serial_normalization rowid Controls how `SERIAL` columns are normalized.
223
225
server_encoding UTF8 Reports the database encoding (always UTF8). This cannot be changed.
Copy file name to clipboardExpand all lines: pkg/sql/session_var_descriptions.go
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,7 @@ var sessionVarDescriptions = map[string]string{
104
104
"initial_retry_backoff_for_read_committed": "Sets the initial backoff duration for automatic retries of statements in explicit READ COMMITTED transactions that encounter retry errors.",
105
105
"inject_retry_errors_enabled": "Causes statements (except SET) inside explicit transactions to return a transaction retry error for testing application retry logic. If the client retries using the cockroach_restart savepoint, the transaction proceeds normally after the 3rd retry error.",
106
106
"inject_retry_errors_on_commit_enabled": "Causes statements inside explicit transactions to return a retry error just before transaction commit for testing retry logic.",
107
+
"in_hot_standby": "Reports whether the server is currently in hot standby mode (always off in CockroachDB).",
107
108
"integer_datetimes": "Reports whether integer datetime representation is used (always on).",
108
109
"internal": "Indicates whether this query came from InternalExecutor or an internal planner.",
109
110
"intervalstyle": "Controls the display format for `INTERVAL` values.",
@@ -185,6 +186,7 @@ var sessionVarDescriptions = map[string]string{
185
186
"parallelize_multi_key_lookup_joins_max_lookup_ratio": "Sets the maximum lookup ratio threshold for parallelizing multi-key lookup joins.",
186
187
"parallelize_multi_key_lookup_joins_only_on_mr_mutations": "Controls whether parallelization of multi-key lookup joins is restricted to multi-row mutations only.",
187
188
"password_encryption": "The encryption method used for passwords.",
189
+
"scram_iterations": "Reports the iteration count for SCRAM-SHA-256 password hashing.",
188
190
"pg_dump_compatibility": "Controls how CockroachDB presents metadata to external tools. Valid values: off (default), postgres (suppress CRDB-specific syntax for pg_dump compatibility), cockroachdb (show CRDB syntax explicitly).",
189
191
"pg_trgm.similarity_threshold": "Sets the value used to compare trigram similarities for the string % string overload.",
190
192
"plan_cache_mode": "Controls the method that the optimizer should use to choose between a custom and generic query plan.",
0 commit comments