[Info-ingres] Changing Database Ownership

Roy Hann specially at processed.almost.meat
Thu Jan 6 18:12:27 UTC 2022


Rich Ford wrote:

> I need to change some databases ownership for DBAs who have left the company.
>
> Part of the instructions state to "login as the CURRENT DBA of 

First off, this is an example of why I suggest creating special user IDs
for the sole purpose of "owning" databases. It is imprudent and
unnecessary to have real users as database owners. But that ship sailed
long ago...

Changing the name of the owner of the database now is probably
infeasible. The only supported way I can think of to do it would be to
unload, destroy, recreate, and reload the database. 

This is not ideal, but starting from where you are, I'd probably just
first make sure no one can ever log in using the current owners'
ID--delete their password or whatever it takes. Then to access the
databases from now on I would either use the -u flag to impersonate
the owner when I connect, or, once connected, use the SET SESSION
AUTHORIZATION command to impersonate them. (This is sort of like doing
su or sudo and only a user with Ingres security_administrator
privileges can do it.)

Of course if you'd like some encouragement to get into unsupported
hackery, I or someone else here can probably whisper evil advice
if you insist. It's not my database.   >:-)

Roy


More information about the Info-ingres mailing list