-
-
Notifications
You must be signed in to change notification settings - Fork 250
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
By default, require superuser privileges to install a pgx extension #1056
By default, require superuser privileges to install a pgx extension #1056
Conversation
pgx
extension with superuser
privilegespgx
extension without superuser
privileges
6d916fa
to
99efb94
Compare
I don't believe it's correct for the pgx extension template to default to And with that in mind, I'd say that setting In other words, it seems more correct for pgx to default to creating extensions that are untrusted and require superuser privileges to create. An extension developer can better make these decisions about their own extension. |
99efb94
to
15b2eb7
Compare
@eeeebbbbrrrr, it makes sense. I've reverted the changes related to |
For future reference, please note that we prefer PRs made against the I'm fine to merge this but I wouldn't mind @workingjubilee's input first (these options are documented at https://www.postgresql.org/docs/current/extend-extensions.html#id-1.8.3.20.11). Over the past year, Jubilee has taught me an entirely different perspective on safety and correctness. |
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.
Yes, using superuser = true
is correct according to this because even though superuser = false
won't be an escalation of privileges, 99.9% of the time we will be creating a "C" language function which will fail to install. So we might as well do so immediately.
We are indeed working on making a subset of Rust installable without superuser privileges, but normally, pgx has all the capabilities needed to do "fun" things to a database. It requires the superuser's consent to do such things.
pgx
extension without superuser
privileges
Funny how this PR got turned into the exact opposite of what was desired, but I'm glad we're all on the same page. Thanks @vadim2404, merging now. |
An error occurs when the user without root privileges tries to install extensions compiled via
pgx
.For instance,
pg_graphql
is written onRust
usingpgx
. And if the user has access only to one database created especially for him, he'll seecreate extension pg_graphql; ERROR: permission denied for language c (SQLSTATE 42501)
It happens because the
C
language is untrusted by default in Postgres. These changes allow non-privileged users to install extensions without markingC
as trusted.