pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrus <kobruleht2@hot.ee>
To: pgsql-general@postgresql.org
Subject: REASSIGN OWNED BY in current database only
Date: Fri, 15 Jan 2021 09:45:15 +0200
Message-ID: <a305fb19-3cbe-8b61-ea53-e8c2d6551a99@hot.ee> (raw)

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.

Message-ID: <a305fb19-3cbe-8b61-ea53-e8c2d6551a99@hot.ee>
Permalink:  ../a305fb19-3cbe-8b61-ea53-e8c2d6551a99@hot.ee/
Also on:    postgresql.org/message-id/a305fb19-3cbe-8b61-ea53-e8c2d6551a99@hot.ee

 · 

reply

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: kobruleht2@hot.ee
  Subject: Re: REASSIGN OWNED BY in current database only
  In-Reply-To: <a305fb19-3cbe-8b61-ea53-e8c2d6551a99@hot.ee>
  References: <a305fb19-3cbe-8b61-ea53-e8c2d6551a99@hot.ee>

* 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