-
Notifications
You must be signed in to change notification settings - Fork 179
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
--no-superuser-check does not work #223
Comments
Thank you for looking into this. Can you provide a patch please? |
IIRC the https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.html I'm not opposed to a change/fix here, but it would be nice if we could avoid breaking functionality for users on RDS. |
We might event want to keep it simple and wontfix this, documenting that |
The binary correctly checks and blocks non-super user access, and correctly respects the Is the secondary check in the backend code actually needed? Sure, it prevents non-superusers from calling the functions directly in the DB, but the binary (intends) to add that functionality anyway. |
We use own package with that patch:
|
This option also works for DigitalOcean's Managed Databases. Leaving this for future finders. |
In essence, |
Personally, I don't see why a non-superuser should be allowed to use pg_repack since I consider this a purely DBA/administrative activity. But perhaps there are exceptions to this rule that I'm not considering. |
Some hosted providers do not allow privileged access. For instance, AWS RDS. |
@vadim2404 , AWS RDS allows privileged access. rds_superuser is privileged access. |
But still, it requires https://www.magistratehq.com/blog/using-pgrepack-in-aws-rds/ |
Ha, ok, you got me on that one! Although I can't get used to the thought that rds_superuser is not a superuser. True, it cannot do everything that a OnPrem superuser can do, but... |
Yes, not everything is possible under the rds_superuser. Therefore this flag is helpful |
It'd be great to have formal support for running pg_repack as a non-superuser. We have a user in production with escalated permissions that manages tables with dynamic schemas (which we use to improve performance), and we need to manage bloat on those dynamic tables, but don't really want to have superuser credentials floating in memory of that user. It should be able to repack tables it owns and has all permissions on, just not everything else. Are there any technical blockers to making that work? |
|
I'm encountering this very error on AWS RDS Postgres 16.3 with pg_repack extension 1.5.0 and pg_repack client 1.5.0 |
The PR #431 was release with Amazon provides its own |
AWS offers up to Postgres 17.2
17.2 only supports up to pg_repack 1.5.1
We are on Postgres 16.3 and pg_repack 1.5.0. We have been unable to run pg_repack as a non-superuser using the -k option, which is what the original issue was about.
We'll just have to keep having DevOps with their superuser login run pg_repack until AWS supports a version of Postgres that works with pg_repack 1.5.2
Thanks
From: Artur Zakirov ***@***.***>
Sent: Thursday, January 9, 2025 6:04 AM
To: reorg/pg_repack ***@***.***>
Cc: Bill A Coulam ***@***.***>; Comment ***@***.***>
Subject: Re: [reorg/pg_repack] --no-superuser-check does not work (#223)
The PR #431<#431> was release with pg_repack 1.5.2.
Amazon provides its own pg_repack on RDS. If I'm not mistaken it should allow to run by non-superuser if you use -k option.
-
Reply to this email directly, view it on GitHub<#223 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BIFPGUWFZ5DE2A7DRLGQGRD2JZXU3AVCNFSM6AAAAABI7C6AOWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOBQGEYDIOJZGU>.
You are receiving this because you commented.Message ID: ***@***.******@***.***>>
|
The
--no-superuser-check
does not work. When passed in as an option, it fails with:Looking at the code - its failing here https://github.com/reorg/pg_repack/blob/master/lib/repack.c#L111
This always evaluates to the actual superuser status of the user.
I don't see
superuser()
defined anywhere in pg_repack - so I presume that is coming in from Postgres includes.Initial discussion in #201
The text was updated successfully, but these errors were encountered: