Re: How to restore a dump containing CASTs into a database with a new user? - Mailing list pgsql-general

From Tom Lane
Subject Re: How to restore a dump containing CASTs into a database with a new user?
Date
Msg-id 206414.1595183867@sss.pgh.pa.us
Whole thread Raw
In response to How to restore a dump containing CASTs into a database with a new user?  (Thorsten Schöning <tschoening@am-soft.de>)
Responses Re: How to restore a dump containing CASTs into a database with a new user?
List pgsql-general
=?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



pgsql-general by date:

Previous
From: Thorsten Schöning
Date:
Subject: How to restore a dump containing CASTs into a database with a new user?
Next
From: "David G. Johnston"
Date:
Subject: Re: Re: PG 9.5.5 cores on AIX 7.1