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.mjs CHANGED
@@ -5107,6 +5107,11 @@ const collationsSql = (version) => `SELECT
5107
5107
  FROM pg_collation
5108
5108
  JOIN pg_namespace n on pg_collation.collnamespace = n.oid
5109
5109
  WHERE ${filterSchema("n.nspname")}`;
5110
+ /**
5111
+ * Fixed oid of the bootstrap superuser created by `initdb` (`BOOTSTRAP_SUPERUSERID` in PostgreSQL sources).
5112
+ * Its name may differ from `postgres`, and it cannot be dropped.
5113
+ */
5114
+ const BOOTSTRAP_SUPERUSER_OID = 10;
5110
5115
  const roleSql = (params) => `SELECT COALESCE(json_agg(json_build_object(
5111
5116
  'name', rolname,
5112
5117
  'super', rolsuper,
@@ -5119,7 +5124,7 @@ const roleSql = (params) => `SELECT COALESCE(json_agg(json_build_object(
5119
5124
  'validUntil', rolvaliduntil,
5120
5125
  'bypassRls', rolbypassrls,
5121
5126
  'config', rolconfig
5122
- )), '[]') FROM pg_roles WHERE ${params.whereSql ?? `rolname != 'postgres' AND rolname !~ '^pg_'`}`;
5127
+ )), '[]') FROM pg_roles WHERE ${params.whereSql ?? `oid != ${BOOTSTRAP_SUPERUSER_OID} AND rolname != 'postgres' AND rolname !~ '^pg_'`}`;
5123
5128
  const defaultPrivilegesSql = `SELECT COALESCE(json_agg(t.*), '[]') FROM (
5124
5129
  SELECT
5125
5130
  (ae.grantor)::regrole "grantor",