Skip to content

Commit

Permalink
Revert "Revoke REPLICATION" (#7261)
Browse files Browse the repository at this point in the history
Reverts #7052
  • Loading branch information
Sasha Krassovsky committed Mar 27, 2024
1 parent 7f9cc1b commit 24c5a5a
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions compute_tools/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,9 @@ pub fn handle_roles(spec: &ComputeSpec, client: &mut Client) -> Result<()> {
RoleAction::Create => {
// This branch only runs when roles are created through the console, so it is
// safe to add more permissions here. BYPASSRLS and REPLICATION are inherited
// from neon_superuser. (NOTE: REPLICATION has been removed from here for now).
// from neon_superuser.
let mut query: String = format!(
"CREATE ROLE {} INHERIT CREATEROLE CREATEDB BYPASSRLS IN ROLE neon_superuser",
"CREATE ROLE {} INHERIT CREATEROLE CREATEDB BYPASSRLS REPLICATION IN ROLE neon_superuser",
name.pg_quote()
);
info!("running role create query: '{}'", &query);
Expand Down Expand Up @@ -806,19 +806,8 @@ $$;"#,
"",
"",
"",
"",
// Add new migrations below.
r#"
DO $$
DECLARE
role_name TEXT;
BEGIN
FOR role_name IN SELECT rolname FROM pg_roles WHERE rolreplication IS TRUE
LOOP
RAISE NOTICE 'EXECUTING ALTER ROLE % NOREPLICATION', quote_ident(role_name);
EXECUTE 'ALTER ROLE ' || quote_ident(role_name) || ' NOREPLICATION';
END LOOP;
END
$$;"#,
];

let mut query = "CREATE SCHEMA IF NOT EXISTS neon_migration";
Expand Down

1 comment on commit 24c5a5a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2810 tests run: 2658 passed, 0 failed, 152 skipped (full report)


Code coverage* (full report)

  • functions: 28.2% (6307 of 22367 functions)
  • lines: 47.0% (44289 of 94303 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
24c5a5a at 2024-03-27T19:08:27.510Z :recycle:

Please sign in to comment.