# Can the admin user have CREATEROLE and BYPASSRLS? (no superuser)

**URL:** <https://community.fly.io/t/can-the-admin-user-have-createrole-and-bypassrls-no-superuser/28697>\
**Category:** Questions / Help\
**Tags:** mpg\
**Created:** [September 24, 2026, 2:35pm UTC](https://community.fly.io/t/can-the-admin-user-have-createrole-and-bypassrls-no-superuser/28697 "2026-09-24T14:35:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Visto](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@Visto](https://community.fly.io/u/Visto)\
**Post date:** [September 24, 2026, 2:35pm UTC](https://community.fly.io/t/can-the-admin-user-have-createrole-and-bypassrls-no-superuser/28697/1 "2026-09-24T14:35:23Z")

</div>

We’re planning to move to Managed Postgres from an unmanaged postgres-flex cluster (18.x). Our migrations run as an “owner” role that is not a superuser, and we’ve narrowed what it needs down to two attributes:

- CREATEROLE: the migrations CREATE ROLE … LOGIN for the application roles and run ALTER ROLE … SET search\_path.
- BYPASSRLS: several tables use FORCE ROW LEVEL SECURITY, and the owner (and the SECURITY DEFINER functions it owns) has to bypass it. Without it, one of our first data migrations fails with “new row violates row-level security policy”.

We also use the pgcrypto and pgvector extensions.

Questions:

1. Can the Schema Admin user (fly-user), or a user created with `fly mpg users create`, have the CREATEROLE and BYPASSRLS attributes? If not, is there a supported way to get them?
2. Can that user manage the roles it creates afterwards (GRANT … WITH ADMIN OPTION, ALTER ROLE on those roles)? Is the createrole\_self\_grant setting available?
3. pgvector is documented as supported, but it is not a “trusted” extension. Who runs CREATE EXTENSION vector, and can the migration user run CREATE EXTENSION IF NOT EXISTS vector when it is already installed?
4. Which major versions are available?

The docs describe Schema Admin as the closest role to a superuser but don’t list its attributes. Thanks!

---

<div class="post-metadata">

**Author:** ![flyio-support](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/flyio-support/32/46245_2.png) [@flyio-support](https://community.fly.io/u/flyio-support)\
**Post date:** [September 24, 2026, 3:46pm UTC](https://community.fly.io/t/can-the-admin-user-have-createrole-and-bypassrls-no-superuser/28697/2 "2026-09-24T15:46:42Z")

</div>

Hi there,

We can add BYPASSRLS to an existing role manually, but we cannot grant your users CREATEROLE as then they might muck up the system roles we need to properly manage your MPG cluster.

pgvector should totally be supported/used; we have many users running it. DId you enable it via the MPG dashboard’s extension tabs?

Which major versions of what, are you asking about?

Cheers!

---

<div class="post-metadata">

**Author:** ![patrickdonahue](https://avatars.discourse-cdn.com/v4/letter/p/b9e5f3/32.png) [@patrickdonahue](https://community.fly.io/u/patrickdonahue)\
**Post date:** [October 1, 2026, 6:49pm UTC](https://community.fly.io/t/can-the-admin-user-have-createrole-and-bypassrls-no-superuser/28697/4 "2026-10-01T18:49:50Z")

</div>

On question 3, the migration side is fine once the extension is enabled from the MPG dashboard. `CREATE EXTENSION IF NOT EXISTS` checks for the existing extension before it checks whether you’re allowed to create it, so a non-superuser gets a notice instead of an error.

Quick check on plain Postgres 17, with `vector` already installed by a superuser and a migration role that has no superuser attributes:

```auto
mig_owner=> create extension if not exists vector;
NOTICE: extension "vector" already exists, skipping

mig_owner=> create extension if not exists pg_buffercache;
ERROR: permission denied to create extension "pg_buffercache"
HINT: Must be superuser to create this extension.

```

(`vector` and `pg_buffercache` are both untrusted, `trusted = f` in `pg_available_extension_versions`.) So keep the `IF NOT EXISTS` in your migrations and enable the extension through the dashboard first. A plain `CREATE EXTENSION vector` without `IF NOT EXISTS` will still fail, it just fails with “already exists” instead.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/fly1/original/3X/6/e/6e8955d00cb218e186ebbe3a6ab06fefdce15290.svg) [@system](https://community.fly.io/u/system)\
**Post date:** [October 11, 2026, 6:49pm UTC](https://community.fly.io/t/can-the-admin-user-have-createrole-and-bypassrls-no-superuser/28697/5 "2026-10-11T18:49:58Z")

</div>

Closed on October 11, 2026, 6:49pm UTC

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
