Summary
The LQL transpiler accepts only 1-arg current_setting('name') in policy using: predicates and in function bodyLql: blocks, and auto-emits the second missing_ok=true argument when lowering to SQL.
The standard PostgreSQL current_setting(name, missing_ok) 2-arg form is rejected with:
LQL-PARSE: policy '<name>': current_setting() requires exactly one string-literal argument
Why this matters
Authors who know stock PostgreSQL reach for the 2-arg form when they want explicit missing_ok=true semantics on a GUC that may be unset. They write what works on a psql prompt and the migrate fails at apply time, not parse time, with an opaque LQL-PARSE error.
Repro
policies:
- name: example
using: "current_setting('app.tenant_id', true) = ''"
→ LQL-PARSE error.
policies:
- name: example
using: "current_setting('app.tenant_id') = ''"
→ Accepted; transpiler emits current_setting('app.tenant_id', true) = '' (correct).
Proposed fix
Either:
- Accept the 2-arg form and pass through verbatim (idiomatic PG), OR
- Update the LQL-PARSE error to point at the 1-arg convention and the auto-missing_ok behaviour.
Found via
tenants_self_membership_select RLS policy in NimblesiteAgenticPlatform/migrations/schema.yaml (PR #119).
Summary
The LQL transpiler accepts only 1-arg
current_setting('name')in policyusing:predicates and in functionbodyLql:blocks, and auto-emits the secondmissing_ok=trueargument when lowering to SQL.The standard PostgreSQL
current_setting(name, missing_ok)2-arg form is rejected with:Why this matters
Authors who know stock PostgreSQL reach for the 2-arg form when they want explicit
missing_ok=truesemantics on a GUC that may be unset. They write what works on a psql prompt and the migrate fails at apply time, not parse time, with an opaque LQL-PARSE error.Repro
→ LQL-PARSE error.
→ Accepted; transpiler emits
current_setting('app.tenant_id', true) = ''(correct).Proposed fix
Either:
Found via
tenants_self_membership_selectRLS policy inNimblesiteAgenticPlatform/migrations/schema.yaml(PR #119).