Skip to content

feat: take over #199 and adapt for v2#312

Closed
fernandezcuesta wants to merge 3 commits intocrossplane-contrib:masterfrom
fernandezcuesta:follow-up-199
Closed

feat: take over #199 and adapt for v2#312
fernandezcuesta wants to merge 3 commits intocrossplane-contrib:masterfrom
fernandezcuesta:follow-up-199

Conversation

@fernandezcuesta
Copy link
Contributor

@fernandezcuesta fernandezcuesta commented Feb 10, 2026

Description of your changes

Adds support to DefaultPrivileges for postgres.
Fixes #117

This is a follow up of #199.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

Locally with a kind cluster, running from the examples folder and verified with:

  SELECT                                                                                                                                                                                                                                 
      pg_get_userbyid(d.defaclrole) AS target_role,                                                                                                                                                                                        
      CASE d.defaclobjtype                                                                                                                                                                                                                 
          WHEN 'r' THEN 'table'                                                                                                                                                                                                            
          WHEN 'f' THEN 'function'                                                                                                                                                                                                         
          WHEN 'S' THEN 'sequence'                                                                                                                                                                                                         
          WHEN 'T' THEN 'type'
          WHEN 'n' THEN 'schema'
      END AS object_type,
      n.nspname AS schema,
      pg_get_userbyid((aclexplode(d.defaclacl)).grantee) AS grantee,
      (aclexplode(d.defaclacl)).privilege_type
  FROM pg_default_acl d
  LEFT JOIN pg_namespace n ON d.defaclnamespace = n.oid
  ORDER BY target_role, object_type, grantee;

Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
@fernandezcuesta
Copy link
Contributor Author

Closing in favor of original PR #199

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support DefaultPrivileges

1 participant