Re: How to drop user if objects depend on it

Поиск
Список
Период
Сортировка
От Melvin Davidson
Тема Re: How to drop user if objects depend on it
Дата
Msg-id CANu8FizGPVRLtzf2Z4KmxE8XGTWtKwOiK4waULt8BFbyX_DCyQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to drop user if objects depend on it  ("Andrus" <kobruleht2@hot.ee>)
Список pgsql-general
Andrus,

>is running by superuser but it still causes the error.

That does not sound right. Please verify you are running as user postgres with:

SELECT current_user;

Then make sure postgres is still a superuser with:

SELECT rolname as user,
       CASE WHEN rolcanlogin THEN 'user'
            ELSE 'group'
       END,
       CASE WHEN rolsuper THEN 'SUPERUSER'
            ELSE 'normal'
        END AS super
  FROM pg_authid
WHERE rolname = 'postgres';

If you still get errors, then please show the exact error to us.


On Wed, Oct 7, 2015 at 11:11 AM, Andrus <kobruleht2@hot.ee> wrote:
Hi!

No. You need to be a superuser to reassign objects unless you own the object.
1. first connect as user postgres
2. REASSIGN all the tables owned by the missing user first.
3. Then you can drop the missing user AFTER you have reassigned all the objects they own.

Script

reassign owned by farukkugay to postgres;
drop user farukkugay ;

is running by superuser but it still causes the error.


You must also be a superuser to drop roles.

Non-superuser creates roles, assigns rights and drop users using scripts which I provided.
Those scripts work OK on most cases.

For some users, vantaa and farukkugan  delete script causes error which I described. For farukkugan it occurs also if running under superuser.

So it looks like it should be possible for non-superusers also.

Andrus.



--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.

В списке pgsql-general по дате отправления:

Предыдущее
От: "john.tiger"
Дата:
Сообщение: using postgresql for session
Следующее
От: Tom Lane
Дата:
Сообщение: Re: How to drop user if objects depend on it