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 1jxWtF-0004H6-PA for pgsql-general@arkaria.postgresql.org; Mon, 20 Jul 2020 14:35:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jxWsi-000441-Qr for pgsql-general@arkaria.postgresql.org; Mon, 20 Jul 2020 14:35:04 +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 1jxWsi-00043u-JB for pgsql-general@lists.postgresql.org; Mon, 20 Jul 2020 14:35:04 +0000 Received: from smtp123.iad3a.emailsrvr.com ([173.203.187.123]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jxWsf-0002cB-JH for pgsql-general@lists.postgresql.org; Mon, 20 Jul 2020 14:35:04 +0000 X-Auth-ID: xof@thebuild.com Received: by smtp32.relay.iad3a.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id 2708556F6; Mon, 20 Jul 2020 10:34:58 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.5\)) Subject: Re: How to restore a dump containing CASTs into a database with a new user? From: Christophe Pettus In-Reply-To: <315697639.20200720112813@am-soft.de> Date: Mon, 20 Jul 2020 07:34:57 -0700 Cc: pgsql-general@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: 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> To: =?utf-8?Q?Thorsten_Sch=C3=B6ning?= X-Mailer: Apple Mail (2.3445.9.5) X-Classification-ID: 50e4e4ba-c379-406d-92a6-79dff860b53b-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Jul 20, 2020, at 02:28, Thorsten Sch=C3=B6ning = wrote: >=20 > Would be far easier if Postgres would do that automatically like it > seems to do for most other objects. The important point is that owning > those types seems to be per database, so things should be safe to do > automatically. I'm not sure I understand exactly how this "feature" would work. It = seems to be "in the case that I am using CASTs that include internal = types and restoring to a different, non-superuser user than the original = one in the database that was dumped from, change the owner of internal = types to make sure that my CAST restores work." That strikes me as a = *very* ad hoc feature indeed. -- -- Christophe Pettus xof@thebuild.com