Consider creating pg_durable operators in df schema instead of public
pgspot flagged that pg_durable operators are currently created in schema 'public' instead of 'df'. Consider moving them instead of polluting the public namespace.
Opened #226 to address this.
The fix
All 7 DSL operators (~>, |=>, &, |, ?>, !>, @>) are moved out of public and created in the df schema, so the extension no longer pollutes the public namespace (clears the pgspot PS017 flag). For existing installs, the upgrade script drops the old public operators and recreates them under df.
Keeping the operator syntax ergonomic
Operators in df.start('a' ~> 'b') are resolved in the caller's session, so moving them to df means df has to be on the session search_path for the unqualified infix syntax to resolve (operators can't be schema-qualified inline). Rather than make every user hand-edit search_path, df.grant_usage(role) now manages it during onboarding:
- New optional parameter
set_search_path boolean DEFAULT true— appendsdfto the role'ssearch_pathviaALTER ROLE(append-only and idempotent). Passset_search_path => falseto opt out and manage it yourself. df.revoke_usage(role)removes thedfentry again, preserving any other entries.- Both tolerate
insufficient_privilegewith aNOTICE, so a delegated admin who can't alter the target role still completes the grant/revoke.
So users get the ergonomic operator syntax out of the box without manual setup.
Backward compatibility
The new .so still works against a non-upgraded (≤ 0.2.2) schema: operators stay in public there and the default search_path already includes public, and the original 3-arg grant_usage / revoke_usage remain callable exactly as before. After ALTER EXTENSION UPDATE, operators move to df and grant_usage/revoke_usage gain the search_path behavior.
Docs and examples (USER_GUIDE.md, README.md, grammar/api-reference/architecture/upgrade-testing docs, the SQL skill, and example files) are updated to document the search_path story.
Update: after discussion with the maintainers, we've decided to keep the operators in the public schema rather than move them to df.
The move would be backward-incompatible — existing users and downstream/managed PostgreSQL deployments depend on the operators resolving from public without search_path changes, so a relocation would break already-deployed workloads. The consensus, including from contributors with more extension experience, is that leaving them in public is acceptable here.
The pgspot PS017 finding will be treated as an accepted/allowlisted exception. Closing #226 (the move) without merging and closing this as not planned. Thank you @pinodeca for update on this.