Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xAWpl-00000002hUk-0tOF for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Sep 2026 18:09:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xAWpk-00000004wIE-27Hk for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Sep 2026 18:09:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xAWpk-00000004wI6-0WYs for pgsql-hackers@lists.postgresql.org; Sat, 26 Sep 2026 18:09:12 +0000 Received: from mail-vs2-x0f.google.com ([2a00:1450:4864:3a::f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1xAWph-00000001O7h-3u28 for pgsql-hackers@lists.postgresql.org; Sat, 26 Sep 2026 18:09:11 +0000 Received: by mail-vs2-x0f.google.com with SMTP id 71dfb90a1353d-5ce598f2f13so9945e0c.3 for ; Sat, 26 Sep 2026 11:09:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790446149; x=1791050949; darn=lists.postgresql.org; h=mime-version:content-transfer-encoding:content-type:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=DNJfX3DlN01nHmv2wb3K2FtScyOkllpLCxa/J6O5JJE=; b=AnBZu6/wRY6sIC40qcZ/gx6P/WQL3OyX4EdCLqfTFMWIlx1C0ZsCjkPcNdpK6d7aSr kzim5Zov3hRgXbaAUvDw3gK6uvhITyHqZbQeg/eOJLokGsYbiam2tls/PTaBfn3UoXL1 DfxrDvuTjtpGHWjT0YqQXpHjtCKE7IROWmH6Hy58Ytc1hwr6/iZij00jN4a6nu9wf/xy FuCL9npBI7nTmyOign/Y2Lu+YLO+JT9WmrrG8+uGe/zP3nX/tf2ivTtl0Dot7ordoE4T cBGeB1fjam24/HQGIhuL4thFMOd+N/h1/rG3aSB6DLMP5DNh3CTR4nzTpo+4yz8244+K 98QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790446149; x=1791050949; h=mime-version:content-transfer-encoding:content-type:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=DNJfX3DlN01nHmv2wb3K2FtScyOkllpLCxa/J6O5JJE=; b=C0IVh2TZGiK7jzrqufyNrCCyr6yw4vuKEhqfDU2AhRrsJ1i5lpacg/wscVnRVAy6pl /UYrdsDNsyj3Cwy91K/YvvjSwEGDg7w4yQ1GGNwSmoMQXV/zAF8YuwXNsF83+qDQ8s9w UCku5d5gOnMapbfJeGIT1hDLcQFskJU0MDD3pACwxyGh73XXbJhpL7ETmQ8AvxKmq77i hMswAwwCxWEmY9YiSpd44jqE+ANDe4kQVy0Q2mhGRdnPKVJlWsNWRxevGsh2Q2Wf9ZES BCvHp+Ea7+En0/D50syyI9uWs2zi7wDhjAUqcUQhZd7frOSPLlh+D3lUh/ZkJ0J0da6N /vVQ== X-Forwarded-Encrypted: i=1; AKwUvBzkjMStTRpNjgzAu8wlLYLRYvF3kKett/l2e3ACM2dVEK4EEJtOIP7cTcLm/tsaFezzoUJsxbzzbBTTTpp6@lists.postgresql.org X-Gm-Message-State: AFuF++m4IKGyarPNuJ/IJm3IqLdoe4OoHM8JH+sd4ZVS79y7UBFIyMY9 XfgImVjSI3AYWjAjQoKPqwDFDqMpXIu/XvLFRDsWerjsj0++Qwpe7gw4 X-Gm-Gg: AYBFou3T/Re96DrwgzhyzJ6uBbnn117Wfd6yPv4mDIxn8DpA31XdQBv5qycXRSFNGB0 ZFIYDhxPWXDVy+njQ1T3XbPX9a4nC0/3F7vFh5PL6xfjOV6LRswgspNWYj608nRpWESVpoA10v+ ZB+CNiTMJrQ/FN4f74zaMWEejRGL3yxUbwdbAG1CAVHGxIj55ilV6nK/BBfkbd6LyX0lFLd4/ie 5O85kqNhXR+2QkDbJgLdj2eLvPa95krqJCI+LRLhkNdwGe5fqEWJ5Dhx4Vg5nA0bI9HtHmaqg6u UQED+rOYUIcEQGPn0CHXrYPqaL6mnZT84BPcAPMrV9jEKCdovjOSuM6ZtJnqzIR0ckvlxnuUtkQ yeLRGQHok4aY2QApvux7Gy4sUnkLF9aaywg8fAa1EtAihH0eyxQHe5QIIG7SyJ9C1l0V6kaI71n Hqez60Ibq+KVEbw9wap2+4S9M5UCk4BplMvjzrUmIb06L93z2aHKNMDToNJUtOVT6YfSGWgWXfc 07ZQM2gLKdG1zr/KS8wYwWsMLBNwAPuRwY2Po58mFJwqDA13oHrPWhByq9J5hLwTENUkCTEHMGe tud6p8KhO7bx5MonZTkDzzIXcA== X-Received: by 2002:a05:6122:2088:b0:5c9:91ba:5d7a with SMTP id 71dfb90a1353d-5cc485d6edfmr2053491e0c.1.1790446149431; Sat, 26 Sep 2026 11:09:09 -0700 (PDT) Received: from 192.168.1.109 ([2803:3c90:cee:ea00:5c3c:7e70:29e3:7a55]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-5cde4f969b9sm2636042e0c.3.2026.09.26.11.09.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2026 11:09:08 -0700 (PDT) From: Manu To: Jelte Fennema-Nio Cc: Robert Haas , Tomas Vondra , Julien Rouhaud , pgsql-hackers@lists.postgresql.org Subject: Re: Extension security improvement: Add support for extensions with an owned schema Date: Sat, 26 Sep 2026 15:09:04 -0300 Message-ID: <179044614455.109724.18419741920404710654@gmail.com> In-Reply-To: References: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Jelte, > 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. I checked that it would have caught this one. With v12-0001 on top of v11, test_pg_dump fails 25 checks, all of them "pg_dump runs without warnings" with the dependency loop warning. With v12 all 1182 pass. (v11 needed test_extensions added to EXTRA_INSTALL to run on its own, which is the Makefile fix in v12.) I re-ran the three cases from my earlier mail with the same scripts, on master 3c5d9d914fa against a REL_18_STABLE (18.6) cluster: - pg_dump, pg_dumpall and pg_upgrade from PG18 all work now; pg_upgrade exits 0. - The owned-schema extension dumps without warnings, plain and --binary-upgrade, and restores with extownedschema = t. - make -C src/test/modules/test_pg_dump check passes on its own. Both patches apply cleanly and build without warnings, and test_extensions, src/bin/pg_dump and src/bin/pg_upgrade pass. One thing about the new comment in pg_dump.c: We still keep the schema's dependency on the extension so the schema's ACL and comment are dumped after CREATE EXTENSION creates the schema. The ACL is: a GRANT on the owned schema comes after CREATE EXTENSION in the dump and survives a plain, directory and parallel restore. The COMMENT is not dumped at all, so it is lost on restore. That looks like the existing rule for extension members rather than something this patch broke; on unpatched master a comment on a function of an extension is lost the same way. But the schema is now a member, so a schema comment that used to survive a dump/restore no longer does, while a same-version pg_upgrade keeps it. Either the code comment should only mention the ACL, or the owned schema's comment could be dumped like its ACL. Regards, Manu