-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
Wrong ownership for some built-in event triggers #1437
Comments
Furthermore, it looks like it's possible to DROP any evtrig by doing CASCADE: -- this works
drop function grant_pg_graphql_access cascade; This despite being owned by the |
So resolution is to reassign the owner for BOTH the event trigger and the event trigger function to |
@soedirgo Yes, correct. They all should be owned by I don't know if these evtrigs are created inside the dashboard somehow to have the |
I think it's owned by |
The steps required for this:
NotesThe problem seems to arise from:
|
Fixes #1437 (comment). Moves migrations/db/init-scripts to migrations/db/migrations.
Fixes #1437 (comment). Moves migrations/db/init-scripts to migrations/db/migrations.
Fixes #1437 (comment). Moves migrations/db/init-scripts to migrations/db/migrations.
Fixes #1437 + Moves migrations/db/init-scripts to migrations/db/migrations. + Make initial migrations idempotent. + Adds test for event triggers.
Fixes #1437 + Moves migrations/db/init-scripts to migrations/db/migrations. + Make initial migrations idempotent. + Adds test for event triggers.
Fixes #1437 + Moves migrations/db/init-scripts to migrations/db/migrations. + Make initial migrations idempotent. + Adds test for event triggers.
Fixes #1437 + Moves migrations/db/init-scripts to migrations/db/migrations. + Make initial migrations idempotent. + Adds test for event triggers.
Reopening since it was reverted on #1500 |
Fixes #1437. Now that the effects of the `migrations/db/init-scripts` are fully tested on the following files: - [nix/tests/sql/auth.out](https://github.com/supabase/postgres/blob/develop/nix/tests/expected/auth.out) - [nix/tests/sql/storage.out](https://github.com/supabase/postgres/blob/develop/nix/tests/expected/storage.out) - [nix/tests/sql/roles.out](https://github.com/supabase/postgres/blob/develop/nix/tests/expected/roles.out) - [nix/tests/sql/evtrigs.out](https://github.com/supabase/postgres/blob/develop/nix/tests/expected/evtrigs.out) - [nix/tests/sql/extensions_schema.out](https://github.com/supabase/postgres/blob/develop/nix/tests/expected/extensions_schema.out) - [nix/tests/sql/realtime.out](https://github.com/supabase/postgres/blob/develop/nix/tests/expected/realtime.out) This reattempts to move `migrations/db/init-scripts` to `migrations/db/migrations` and have a single directory for migrations. Of the above tests, the only change pertains to the event triggers owners which is the problem on #1437. This requires modifying migrations, but the changes are more about following best practices: + Makes migrations idempotent. + [alter default privileges](https://www.postgresql.org/docs/current/sql-alterdefaultprivileges.html) explicitly list postgres as the target role. + Also: - adds a conditional for pgjwt which is not available on the 17 version - Realtime publication maintains the same postgres owner
Problem
See the functions and event trigger owned by
postgres
:This means that any user can DROP those and cause services to malfunction:
Both DROPs above work.
The text was updated successfully, but these errors were encountered: