Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jxXRb-0005Vp-QS for pgsql-general@arkaria.postgresql.org; Mon, 20 Jul 2020 15:11:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jxXR4-0007gb-Oz for pgsql-general@arkaria.postgresql.org; Mon, 20 Jul 2020 15:10:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jxXR4-0007gU-HG for pgsql-general@lists.postgresql.org; Mon, 20 Jul 2020 15:10:34 +0000 Received: from mail.am-soft.de ([83.218.36.120]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jxXQx-0003IK-9z for pgsql-general@lists.postgresql.org; Mon, 20 Jul 2020 15:10:33 +0000 Received: from mail.am-soft.de (localhost [127.0.0.1]) by mail.am-soft.de (Postfix) with ESMTP id E5AA42BEA6F7 for ; Mon, 20 Jul 2020 17:10:25 +0200 (CEST) Received: from tschoening-nb.fritz.box (unknown [77.78.163.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.am-soft.de (Postfix) with ESMTPSA id C7D0F2BEA6F5 for ; Mon, 20 Jul 2020 17:10:24 +0200 (CEST) Date: Mon, 20 Jul 2020 17:10:23 +0200 From: =?utf-8?Q?Thorsten_Sch=C3=B6ning?= Organization: AM-SoFT GmbH IT-Systeme Message-ID: <486383440.20200720171023@am-soft.de> To: pgsql-general@lists.postgresql.org Subject: Re: How to restore a dump containing CASTs into a database with a new user? In-Reply-To: References: <1566481610.20200719202547@am-soft.de> <206414.1595183867@sss.pgh.pa.us> <1834098334.20200719215112@am-soft.de> <229216.1595191074@sss.pgh.pa.us> <929298897.20200719232557@am-soft.de> <1097194106.20200720071316@am-soft.de> <315697639.20200720112813@am-soft.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-AV-Checked: ClamAV using ClamSMTP List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Guten Tag Christophe Pettus, am Montag, 20. Juli 2020 um 16:34 schrieben Sie: > I'm not sure I understand exactly how this "feature" would work. Make internal types used in CASTs owned by the restoring user, like all other objects are owned automatically as well. Postgres obviously is able to detect those problems already and reowning automatically would prevent people from the need to research first and do things manually afterwards. One could optionally introduce an additional flag, but if things like "--role" and "--no-owner" are specified, intention of the users seem pretty clear to me. In the worst case this problem makes people even NOT use individual DB-users and use superuser for everything. Just search for the topic about backing up databases using a read-only user: It's that difficult, that people suggest creating a special superuser set into read-only mode, from which it can recover itself and stuff like that. Simply because granting permissions on unknown schemas and maintaining default permissions for objects nobody knows if they ever will be needed isn't really straightforward. Using one concrete owner for everything right from the start is the best one can do and that includes being able to reown in case of restoring backups. And Postgres supports most of that already, only the CAST-thing has not been thought to an end I guess. Mit freundlichen Gr=C3=BC=C3=9Fen, Thorsten Sch=C3=B6ning --=20 Thorsten Sch=C3=B6ning E-Mail: Thorsten.Schoening@AM-SoFT.de AM-SoFT IT-Systeme http://www.AM-SoFT.de/ Telefon...........05151- 9468- 55 Fax...............05151- 9468- 88 Mobil..............0178-8 9468- 04 AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln AG Hannover HRB 207 694 - Gesch=C3=A4ftsf=C3=BChrer: Andreas Muchow