Expand description
Parser DoS limits.
These limits are uniformly applied at parser entry points so a
malicious query string can’t exhaust recursion stack, RAM, or
identifier bookkeeping. Limit values are documented in
docs/security/parser-limits.md (issue #87).
§Defaults
| Limit | Default | Rationale |
|---|---|---|
max_depth | 128 | Recursive descent + Pratt; well above hand- |
| written queries (typical ≤ 12). | ||
max_input_bytes | 1 MiB | Hard cap on the token stream input. |
max_identifier_chars | 256 | Long enough for legitimate UUID-tagged names, |
| short enough to bound HashMap pressure. |
Callers that need different limits (replication apply, admin DDL
migrations) construct a custom ParserLimits and pass it to
Parser::with_limits.
Structs§
- Parser
Limits - Hard limits enforced by the parser.