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 1jxGox-0003Wc-FI for pgsql-general@arkaria.postgresql.org; Sun, 19 Jul 2020 21:26: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 1jxGow-0005zJ-EU for pgsql-general@arkaria.postgresql.org; Sun, 19 Jul 2020 21:26:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jxGow-0005zA-6P for pgsql-general@lists.postgresql.org; Sun, 19 Jul 2020 21:26:06 +0000 Received: from mail.am-soft.de ([83.218.36.120]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jxGot-0006w5-Bo for pgsql-general@lists.postgresql.org; Sun, 19 Jul 2020 21:26:05 +0000 Received: from mail.am-soft.de (localhost [127.0.0.1]) by mail.am-soft.de (Postfix) with ESMTP id 9AC6A2BDEDCB for ; Sun, 19 Jul 2020 23:26:00 +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 762132BDEDC9 for ; Sun, 19 Jul 2020 23:25:59 +0200 (CEST) Date: Sun, 19 Jul 2020 23:25:57 +0200 From: =?windows-1250?Q?Thorsten_Sch=F6ning?= Organization: AM-SoFT GmbH IT-Systeme Message-ID: <929298897.20200719232557@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: <229216.1595191074@sss.pgh.pa.us> References: <1566481610.20200719202547@am-soft.de> <206414.1595183867@sss.pgh.pa.us> <1834098334.20200719215112@am-soft.de> <229216.1595191074@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1250 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 Tom Lane, am Sonntag, 19. Juli 2020 um 22:37 schrieben Sie: > In this case, you have to restore the cast as superuser, because nobody > else is going to be treated as owning these built-in types. How do I do that when I have large dumps with lots of those CASTs and in worst case don't even know that, because it's of some proprietary app? Would I need to restore the whole dump as super user? But how do I own all those restored contents to some other database user afterwards? And I don't mean individually GRANTing permissions on tables and sequences and ... and taking additionally care of defauolts in case new tables and sequences and ... get added. That reads so complicated. I simply want to make everything in a database owned by one user, like is easily possible in e.g. file systems and is the case with how I restored. But then CASTs don't work easily. Mit freundlichen Gr=FC=DFen, Thorsten Sch=F6ning --=20 Thorsten Sch=F6ning 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=E4ftsf=FChrer: Andreas Muchow