Re: Changing ownership of objects

Поиск
Список
Период
Сортировка
Искать
От
Manuel Sugawara
Тема
Re: Changing ownership of objects
Дата
в 17:51:49
Msg-id
m3adqiei85.fsf@conexa.fciencias.unam.mx
Ответ на
Список
Дерево обсуждения
Changing ownership of objects "Peter Darley" <pdarley@kinesis-cem.com>
Re: Changing ownership of objects Tom Lane <tgl@sss.pgh.pa.us>
Re: Changing ownership of objects Manuel Sugawara <masm@fciencias.unam.mx>
Re: Changing ownership of objects "Joshua b. Jore" <josh@greentechnologist.org>
"Peter Darley"  writes:

> Friends, When I was young and foolish and setting up my DB initially
> I ended up with the objects in my DB owned by random users.  I'd
> like to write a script to change the user for all objects to be the
> same, but I don't see any way to change the ownership of sequences.
> Any ideas?  Thanks, Peter Darley

If you are using some sh descendant somthing like:

for x in `psql -c '\dts' mydb -tA | cut -d\| -f1`; do 
  psql -c "ALTER TABLE $x OWNER TO newowner;" mydb
done

should do the work.

Regards,
Manuel.
В списке pgsql-general по дате отправления
От: Fran Fabrizio
Дата:
Сообщение: horrendous query challenge :-)
От: Tom Lane
Дата:
FAQ