Re: Changing owner of pg_toast tables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mark Styles <postgres(at)lambic(dot)co(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Changing owner of pg_toast tables
Date: 2009-01-29 17:29:07
Message-ID: 5769.1233250147@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Mark Styles <postgres(at)lambic(dot)co(dot)uk> writes:
> On Thu, Jan 29, 2009 at 10:46:08AM -0500, Tom Lane wrote:
>> I guess the interesting question to me is what happened to the tables
>> those toast tables are/were attached to? They should have the same
>> owners as their parent tables.

> They did have the same owner, I changed the owner to postgres so I could
> drop the role, but the corresponding pg_toast tables did not change.

Well, that's just weird. Can you reproduce such a behavior? In my
tests 8.1 definitely does change the toast table's owner along with the
parent. One can imagine that step failing, but if so the whole
ALTER OWNER transaction should roll back.

As for getting out of your immediate problem, I think what you'd need to
do is manually adjust the pg_class.relowner fields for those toast
tables, and then get rid of the pg_shdepend entries that claim they
depend on the old role. (You don't need to put back new entries
claiming they depend on postgres.) But I'd sure like to find out what
happened. We've heard a few reports before of toast tables not getting
dropped when their parents were, and I wonder if this is related.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sebastian Tennant 2009-01-29 17:30:25 Recovery mode
Previous Message David Fetter 2009-01-29 17:22:35 Re: Pet Peeves?