From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thorsten Schöning <tschoening@am-soft.de>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: How to restore a dump containing CASTs into a database with a new user?
Date: Sun, 19 Jul 2020 14:37:47 -0400
Message-ID: <206414.1595183867@sss.pgh.pa.us> (raw)
In-Reply-To: <1566481610.20200719202547@am-soft.de>
References: <1566481610.20200719202547@am-soft.de>
=?utf-8?Q?Thorsten_Sch=C3=B6ning?= <tschoening@am-soft.de> writes:
> Expectation was that whatever gets created in that DB is owned by the
> new user. But I'm running into the following error:
>> pg_restore: [archiver (db)] could not execute query: ERROR: must be owner of type character varying or type inet
The error message seems pretty clear to me.
> Or can the CAST really only be created when the new DB-owner owns
> those types? Is that necessary per database then or globally for the
> public schema or one of the template databases or ...?
It's a security thing. A user who can create such a cast can thereby
change the behavior of other people's queries.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, tschoening@am-soft.de
Subject: Re: How to restore a dump containing CASTs into a database with a new user?
In-Reply-To: <206414.1595183867@sss.pgh.pa.us>
References: <1566481610.20200719202547@am-soft.de> <206414.1595183867@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox