Re: BUG #3709: Changing Table Owner

Lists: pgsql-bugs
From: "Vishesh Jain" <vishesh(dot)jain(at)tcs(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3709: Changing Table Owner
Date: 2007-10-30 07:35:42
Message-ID: 200710300735.l9U7ZgAg076837@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 3709
Logged by: Vishesh Jain
Email address: vishesh(dot)jain(at)tcs(dot)com
PostgreSQL version: 8
Operating system: Linux
Description: Changing Table Owner
Details:

I need to change the owner of some tables from postgres to 'self defined
owner'. Is there any such table where the change in the owner will be
reflected in all the tables? Or any such configuration file to do the same?
Or any ALTER statement?


From: "Moiz Kothari" <moizpostgres(at)gmail(dot)com>
To: "Vishesh Jain" <vishesh(dot)jain(at)tcs(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3709: Changing Table Owner
Date: 2007-10-30 11:26:33
Message-ID: 82e1a9bd0710300426s6213adb8q5884e13f17a7292@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Hi Vishesh,

You can run a dynamic SQL to get all your table owner changed. Try doing
this :

login to your database with postgresql user and then

select 'alter table '|| tablename ||' owner to <self defined owner>;' from
pg_tables where schemaname = 'public';

copy the alter table statements and run it.

Regards,
Moiz Kothari

On 10/30/07, Vishesh Jain <vishesh(dot)jain(at)tcs(dot)com> wrote:
>
>
> The following bug has been logged online:
>
> Bug reference: 3709
> Logged by: Vishesh Jain
> Email address: vishesh(dot)jain(at)tcs(dot)com
> PostgreSQL version: 8
> Operating system: Linux
> Description: Changing Table Owner
> Details:
>
> I need to change the owner of some tables from postgres to 'self defined
> owner'. Is there any such table where the change in the owner will be
> reflected in all the tables? Or any such configuration file to do the
> same?
> Or any ALTER statement?
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>

--
Hobby Site : http://dailyhealthtips.blogspot.com