rake-db 2.37.9 → 2.37.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5130,6 +5130,11 @@ const collationsSql = (version) => `SELECT
5130
5130
  FROM pg_collation
5131
5131
  JOIN pg_namespace n on pg_collation.collnamespace = n.oid
5132
5132
  WHERE ${filterSchema("n.nspname")}`;
5133
+ /**
5134
+ * Fixed oid of the bootstrap superuser created by `initdb` (`BOOTSTRAP_SUPERUSERID` in PostgreSQL sources).
5135
+ * Its name may differ from `postgres`, and it cannot be dropped.
5136
+ */
5137
+ const BOOTSTRAP_SUPERUSER_OID = 10;
5133
5138
  const roleSql = (params) => `SELECT COALESCE(json_agg(json_build_object(
5134
5139
  'name', rolname,
5135
5140
  'super', rolsuper,
@@ -5142,7 +5147,7 @@ const roleSql = (params) => `SELECT COALESCE(json_agg(json_build_object(
5142
5147
  'validUntil', rolvaliduntil,
5143
5148
  'bypassRls', rolbypassrls,
5144
5149
  'config', rolconfig
5145
- )), '[]') FROM pg_roles WHERE ${params.whereSql ?? `rolname != 'postgres' AND rolname !~ '^pg_'`}`;
5150
+ )), '[]') FROM pg_roles WHERE ${params.whereSql ?? `oid != ${BOOTSTRAP_SUPERUSER_OID} AND rolname != 'postgres' AND rolname !~ '^pg_'`}`;
5146
5151
  const defaultPrivilegesSql = `SELECT COALESCE(json_agg(t.*), '[]') FROM (
5147
5152
  SELECT
5148
5153
  (ae.grantor)::regrole "grantor",