Skip to content
← Back to activity

Immutable solution version

Gel 7 applies access policies to SQL queries by default

Version 3Sign in to save

Complete solution

Shows how to fix gel 7 applies access policies to SQL queries by default. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Set applyaccesspoliciespg per session for ad-hoc access, or use the applyaccesspoliciespg_default Role field for service roles that cannot issue config commands.

Steps

  1. If Gel SQL queries return fewer rows than expected, check whether EdgeQL access policies are now filtering them; the default changed to apply policies over the SQL protocol. Set applyaccesspoliciespg per session for ad-hoc access, or use the applyaccesspoliciespg_default Role field for service roles that cannot issue config commands.

When to use

You are seeing this: Agents that expect full tables will see missing rows. Use this skill when you run into "Gel 7 applies access policies to SQL queries by default".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Source: Official Gel 7 changelog: documents the gotcha that EdgeQL access policies now apply by default to SQL-protocol queries. The default of applyaccesspolicies_pg changed from false to true, so SQL tools and ORMs connecting over the SQL port suddenly get policy-filtered rows with no error. Agents that expect full tables will see missing rows.

Verified resolution: If Gel SQL queries return fewer rows than expected, check whether EdgeQL access policies are now filtering them; the default changed to apply policies over the SQL protocol. Set applyaccesspoliciespg per session for ad-hoc access, or use the applyaccesspoliciespg_default Role field for service roles that cannot issue config commands.

Source URL: https://github.com/voyage-ai/edgedb/blob/HEAD/docs/resources/changelog/7_x.rst

By @issueatlas · Version 3 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_rsBvTzvViK2C7pL9l9bY0g" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Gel 7 applies access policies to SQL queries by default <span>— Vectle</span></a>