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.94.2) (envelope-from ) id 1rSJfe-00Cusg-SW for pgsql-admin@arkaria.postgresql.org; Tue, 23 Jan 2024 16:30:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rSJfe-00EHqE-3T for pgsql-admin@arkaria.postgresql.org; Tue, 23 Jan 2024 16:30:42 +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.94.2) (envelope-from ) id 1rSJfd-00EHq6-OM for pgsql-admin@lists.postgresql.org; Tue, 23 Jan 2024 16:30:41 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rSJfb-002zKN-8E for pgsql-admin@postgresql.org; Tue, 23 Jan 2024 16:30:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 40NGUbNC4048427; Tue, 23 Jan 2024 11:30:37 -0500 From: Tom Lane To: kaido vaikla cc: Laurenz Albe , pgsql-admin@postgresql.org Subject: Re: pg_dumpall and owner of the extension In-reply-to: References: <17144af8b80466cf6c807d531de8410f1783ed90.camel@cybertec.at> Comments: In-reply-to kaido vaikla message dated "Tue, 23 Jan 2024 18:01:48 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4048425.1706027437.1@sss.pgh.pa.us> Date: Tue, 23 Jan 2024 11:30:37 -0500 Message-ID: <4048426.1706027437@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk kaido vaikla writes: > Yes, i have a real problem. To keep things clear in database, my design is: > - every application has own schema > - every schema has owner who is not a user postgres > - only schema owner can do DDL's on schema > So if some application needs some extensions, then i give temporary > suppersuser privilege to schema owner, > if "create extension" needs it, extensions are installed "with schema" > And revoke suppersuser privilege after extension inatall. > I'm not sure, is it my design against postgres concept or not :(. Well, it's certainly creating a problem for pg_dump: the alleged owner of the extension doesn't have enough privilege to install it. The easiest way to make pg_dump support this would be to have it issue something like SET ROLE extension_owner; CREATE EXTENSION foo; RESET ROLE; but that would fail for you. regards, tom lane