Search Postgresql Archives

Change owner for all tables in a database in one batch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

by accident I have wrong owner for all tables in my 8.4.13 database:

bukvy=> select * from pg_tables where tableowner = 'skat';
 schemaname |             tablename              | tableowner |
tablespace | hasindexes | hasrules | hastriggers
------------+------------------------------------+------------+------------+------------+----------+-------------
 public     | drupal_actions                     | skat       |
    | t          | f        | f
 public     | drupal_batch                       | skat       |
    | t          | f        | f
 public     | drupal_authmap                     | skat       |
    | t          | f        | f
....
 public     | drupal_watchdog                    | skat       |
    | t          | f        | f
(83 rows)

But they actually should have the user "bukvy" as the owner.

Is there maybe a one-liner for changing the ownership in 1 batch
or should I execute "alter table .... set owner to bukvy" one by one?

Thank you
Alex


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux