REASSIGN OWNED BY in current database only - Mailing list pgsql-general

From Andrus
Subject REASSIGN OWNED BY in current database only
Date
Msg-id a305fb19-3cbe-8b61-ea53-e8c2d6551a99@hot.ee
Whole thread Raw
List pgsql-general

Hi!

Cluster contains lot databases.

All objects in database should owned by separate role  whose name is in form

databasename_owner

where databasename is this database name in cluster.

This role in granted to cluster users who should have acces to this database.

Database is restored  from other cluster where is has different name. After that

REASSIGN OWNED BY originaldbname_owner TO restoreddbname_owner

is used to force this role in restored database.

This command changes also owner of global objects also.

How to change  owner only in current database, leaving global objects owner unchanged ? Andrus.

pgsql-general by date:

Previous
From: Phil Florent
Date:
Subject: RE: Strange (and good) side effect of partitioning ?
Next
From: Soni M
Date:
Subject: could not fsync file ""pg_wal/xlogtemp.23229"": Input/output error