Mattia Eleuteri
f003851338
fix(postgres): refuse system databases and never drop them
...
postgres, template0 and template1 were accepted in databases and handled
like an application database. The init job made <db>_admin their owner,
installed the auto-grant event trigger in them and, once the entry left
values, ran DROP DATABASE on them. That DROP can only fail (template
databases cannot be dropped, and the job is connected to postgres), so
every later upgrade failed in the init job and the release stayed in
UpgradeFailed even after the entry was put back. template1 also passed
the takeover on to every database created from it afterwards, where the
trigger, naming a role about to be dropped, makes CREATE SCHEMA fail.
A release a previous version let take one of them over has to be
repaired without dropping it, and without touching what this chart did
not create: a role or owner that merely carries an expected name may
belong to a tenant or an administrator, and a role comment can be set
by any CREATEROLE holder, so only the cozystack:managed mark is trusted.
What the marked roles own goes to cozystack:orphaned rather than to the
superuser, since a tenant's SECURITY DEFINER function would otherwise
run with superuser rights. A failed lookup of the databases cloned from
template1 has to stop the run before template1 stops being selected, or
those clones would never be repaired.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io >
2026-11-09 11:18:27 +01:00
..
2026-11-09 11:18:27 +01:00
2026-10-09 17:12:14 +03:00
2026-10-26 16:55:36 +03:00
2026-10-26 13:00:10 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 20:23:46 +03:00
2026-11-05 07:56:39 +00:00
2026-10-07 11:04:00 +03:00
2026-11-06 12:33:37 +00:00
2026-11-06 12:33:37 +00:00
2026-11-06 12:33:37 +00:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-11-08 20:18:29 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-13 16:22:43 +03:00
2026-09-27 07:57:30 +03:00
2026-10-07 11:04:00 +03:00
2026-09-10 17:48:22 +05:00
2026-10-07 11:04:00 +03:00
2026-10-16 09:37:14 +00:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-29 13:59:43 +01:00
2026-10-07 11:04:00 +03:00
2026-07-24 11:34:17 +05:00
2026-10-07 11:04:00 +03:00
2026-11-06 12:33:37 +00:00
2026-09-21 12:20:22 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-09-22 17:10:05 +03:00
2026-10-07 11:04:00 +03:00
2026-07-14 13:08:54 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-21 17:50:46 +05:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-09-25 09:46:43 +05:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-11-04 15:03:06 +00:00
2026-11-04 06:57:03 +00:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-11-06 12:33:37 +00:00
2026-11-06 12:33:37 +00:00
2026-10-14 16:24:16 +05:00
2026-10-07 11:04:00 +03:00
2026-10-09 16:57:43 +03:00
2026-09-28 01:32:37 +03:00
2026-10-26 06:17:01 +00:00
2026-10-26 06:17:01 +00:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-08-05 17:37:04 +03:00
2026-10-07 11:04:00 +03:00
2026-10-12 12:00:15 +05:00
2026-10-10 21:47:42 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-02 03:29:15 +03:00
2026-08-28 15:29:29 +05:00
2026-09-26 15:06:42 +03:00
2026-10-09 02:04:39 +03:00
2026-09-05 13:19:17 +05:00
2026-09-05 13:19:17 +05:00
2026-10-03 01:42:38 +03:00
2026-10-07 19:37:25 +03:00
2026-10-03 01:42:38 +03:00
2026-10-03 01:42:38 +03:00
2026-10-09 16:57:43 +03:00
2026-10-01 02:19:17 +03:00
2026-09-05 13:19:17 +05:00
2026-10-07 04:38:06 +03:00
2026-09-05 13:19:17 +05:00
2026-08-23 19:38:49 +05:00
2026-10-09 02:04:40 +03:00
2026-08-07 23:53:40 +03:00
2026-09-05 14:51:06 +05:00
2026-10-20 12:05:33 +03:00
2026-10-07 11:04:00 +03:00
2026-10-13 15:09:00 +03:00
2026-10-07 16:14:34 +03:00
2026-10-06 16:28:51 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-01 19:37:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-19 08:10:26 +00:00
2026-10-19 08:10:26 +00:00
2026-10-07 11:04:00 +03:00
2026-08-12 18:45:22 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-12 09:54:52 +04:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-11 12:49:19 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-11-04 07:06:31 +00:00
2026-10-11 22:40:47 +08:00
2026-11-06 12:33:37 +00:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-21 17:50:46 +05:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-23 19:14:14 +05:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-23 19:14:17 +05:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-09-29 11:29:04 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-09-29 11:20:27 +03:00
2026-10-07 11:04:00 +03:00
2026-09-22 18:53:28 +05:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-08-12 18:42:58 +03:00
2026-07-24 18:16:16 +05:00
2026-10-09 16:57:43 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-11-09 11:18:27 +01:00
2026-11-06 12:33:37 +00:00
2026-10-07 11:04:00 +03:00
2026-09-27 16:58:28 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-08-14 18:37:58 +05:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-08-12 18:16:18 +02:00
2026-10-07 11:04:00 +03:00
2026-09-18 17:45:21 +03:00
2026-10-10 21:15:48 +03:00
2026-10-28 18:38:35 +01:00
2026-10-29 11:31:31 +03:00
2026-10-07 11:04:00 +03:00
2026-10-15 13:29:29 +02:00
2026-10-15 13:29:29 +02:00
2026-10-23 22:53:21 +02:00
2026-10-07 11:04:00 +03:00
2026-10-13 12:34:24 +04:00
2026-10-27 18:38:15 +00:00
2026-11-04 15:03:06 +00:00
2026-11-06 12:33:37 +00:00
2026-10-07 11:04:00 +03:00
2026-10-10 21:15:48 +03:00
2026-10-10 21:15:48 +03:00
2026-10-09 17:12:14 +03:00
2026-10-09 17:12:14 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-14 16:24:16 +05:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 15:41:05 +03:00
2026-10-07 11:04:00 +03:00
2026-10-29 12:34:22 +01:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-10 20:37:53 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-07-24 18:16:16 +05:00
2026-10-13 18:07:35 +04:00
2026-10-29 13:59:43 +01:00
2026-10-21 15:04:39 +05:00
2026-10-21 15:04:39 +05:00
2026-11-04 15:03:06 +00:00
2026-11-04 15:03:06 +00:00
2026-10-20 16:40:06 +05:00
2026-10-20 16:40:06 +05:00
2026-10-19 07:55:37 +00:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 11:04:00 +03:00
2026-10-07 15:41:06 +03:00
2026-10-07 11:04:00 +03:00
2026-09-26 16:08:25 +03:00
2026-10-19 21:18:18 +02:00
2026-10-19 21:18:18 +02:00
2026-10-16 08:18:42 +00:00
2026-10-07 11:04:00 +03:00
2026-10-20 16:40:06 +05:00
2026-10-07 11:04:00 +03:00
2026-10-02 11:02:18 +03:00