-
Notifications
You must be signed in to change notification settings - Fork 613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support setting default_privileges on all schemas #1298
Conversation
postgresql::server::default_privileges is a typethat may have no external impact to Forge modules. This module is declared in 70 of 578 indexed public
|
6f17bc7
to
340dd70
Compare
'absent' => "SELECT 1 WHERE NOT EXISTS (SELECT * FROM pg_default_acl AS da LEFT JOIN pg_namespace AS n ON da.defaclnamespace = n.oid WHERE '%s=%s' = ANY (defaclacl)%s and defaclobjtype = '%s')", | ||
default => "SELECT 1 WHERE EXISTS (SELECT * FROM pg_default_acl AS da LEFT JOIN pg_namespace AS n ON da.defaclnamespace = n.oid WHERE '%s=%s' = ANY (defaclacl)%s and defaclobjtype = '%s')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think actually there is an issue here: if you leave schema
unset and the default privilege exists for a specific schema, the subquery here will return a row, blocking a change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be fixed with the most recent force-push.
340dd70
to
4a15486
Compare
4a15486
to
b23b4dd
Compare
The inline documentation reflected a previous version of the code; this has now been fixed. In particular this should now be backwards compatible. (I think an incompatible change would result in a better interface, but I don't know what requirements you'd have in this case. It could be a very significant difference in a small number of cases!) |
b23b4dd
to
80d95ff
Compare
@fish-face Could you rebase this please? |
The Postgres default is for the absent specification of a schema name when altering default privileges to apply to all schemas. Support that behaviour, but keep the current default behaviour for an unset schema parameter.
80d95ff
to
6aaa1cf
Compare
I think the only failure here was a timeout - is there anything you need from me? |
@fish-face Sorry for leaving this so long, been a little full on here lately. Anyway thanks again for the hard work |
The Postgres default is for the absent specification of a schema name
when altering default privileges to apply to all schemas.
Support that behaviour, but keep the current default behaviour for
an unset schema parameter.
This means that the behaviour doesn't match up with the postgres specification - a better match would be if leaving the
schema
parameter unset also left off theIN SCHEMA
clause, but this would break backwards compatibility.