Re: Extension security improvement: Add support for extensions with an owned schema

From: "Jelte Fennema-Nio" <postgres(at)jeltef(dot)nl>
To: "Manu" <manuelreyesbravo(at)gmail(dot)com>, "Jelte Fennema-Nio" <me(at)jeltef(dot)nl>
Cc: "Robert Haas" <robertmhaas(at)gmail(dot)com>, "Tomas Vondra" <tomas(at)vondra(dot)me>, "Julien Rouhaud" <rjuju123(at)gmail(dot)com>, <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Extension security improvement: Add support for extensions with an owned schema
Date: 2026-09-26 16:16:41
Message-ID: DLPDSPWPW6SS.3KZI2YC6VZVI0@jeltef.nl
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue Sep 22, 2026 at 10:58 PM CEST, Manu wrote:
>> I also think I changed the pg_upgrade to do the correct thing, but I'm
>> not sure how to test this (even manually). Because part of it would
>> only be relevant once we support upgrading from PG18. So for now the
>> upgrade_code I haven't actually run.
>
> That is still true, and unfortunately that code does not work.

Thank you for testing the patch and finding these issues. And to be
clear I had by this point tested this code manually (but that was a long
time ago) and written regression tests that should catch these issues.

> 1. pg_dump against any older server fails
> ------------------------------------------

Yeah this version number bitrotted over time due to new releases
without this patch in it. Fixed now. (this is a gap in our CI, but the
buildfarm would have caught this quickly after commit)

> 2. Every pg_dump of a database with an owned-schema extension warns
> --------------------------------------------------------------------
>
> pg_dump: warning: could not resolve dependency loop among these items:
> pg_dump: detail: EXTENSION loopdemo_owned (ID 2 OID 16386)
> pg_dump: detail: SCHEMA loopdemo_owned (ID 8 OID 16385)

I think this was the best find. Fixed now. And I also included a
separate patch that fails the test_pg_dump regression test if any
warning is emitted by pg_dump/pg_restore so that CI will catch these
kind of failures in the future.

> 3. test_pg_dump cannot be run on its own any more
> --------------------------------------------------
>
> make -C src/test/modules/test_pg_dump check

Fixed now (needed a small Makefile addition). I think I had only tested
it with meson (and CI runs the full test suite not specific tests).

Attachment Content-Type Size
v12-0001-Check-for-pg_dump-restore-warnings-in-test_pg_du.patch text/x-patch 1.4 KB
v12-0002-Add-support-for-extensions-with-an-owned-schema.patch text/x-patch 58.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Lakhin 2026-09-26 17:00:00 Re: Assert failure in try_nestloop_path()
Previous Message Etsuro Fujita 2026-09-26 15:10:23 Re: Several issues with postgres_fdw stats import