=?utf-8?Q?Thorsten_Sch=C3=B6ning?= <tschoening@xxxxxxxxxx> 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