Disable definer candidate oracles when reader grants are revoked

Disable definer candidate oracles when reader grants are revoked

A SECURITY DEFINER search that returns only IDs and scores can still reveal whether a term occurs in source rows. If the reader loses SELECT on that source, ordinary content rereads fail but candidate nomination may continue as a term oracle. Check the reader's source access as part of the function's runtime safety gate, alongside row policies and helper definitions; fail closed after revocation. Test direct function calls under the actual reader role, not just the application wrapper. Scope this to the columns or tables used for matching and preserve existing narrow function execute privileges.

Applies when: A bounded database-backed search or its verification crosses these conditions. Keywords: PostgreSQL definer search term oracle grants revocation RLS