Re: pg_dump fails to set index ownership - Mailing list pgsql-bugs

From Tom Lane
Subject Re: pg_dump fails to set index ownership
Date
Msg-id 12526.1105421131@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_dump fails to set index ownership  (Michael Fuhr <mike@fuhr.org>)
Responses Re: pg_dump fails to set index ownership  (Michael Fuhr <mike@fuhr.org>)
List pgsql-bugs
Michael Fuhr <mike@fuhr.org> writes:
> On Mon, Jan 10, 2005 at 07:28:52PM -0700, Michael Fuhr wrote:
>> pg_dump fails to set ownership on indexes.

> Is this a bug in pg_dump, or is it perhaps a bug in CREATE INDEX?
> Is there any reason CREATE INDEX shouldn't set the index owner to
> be the same as the table owner?

Hm.  CREATE INDEX never did so in the past, and I suspect that at some
point along the line we explicitly decided that that was a good idea.
But it'd be worth thinking about some more.  A related point is that
ALTER TABLE ... OWNER does not recurse to the table's indexes.

The behavior of pg_dump definitely is a bug because it is specifically
associated with the change to emit ALTER ... OWNER commands instead of
SET SESSION AUTHORIZATION commands --- if you select the latter option
then the indexes are created with the right ownership.  So I went in and
fixed it to make the ALTER OWNER path behave the same as the historical
behavior has been.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: pg_dump fails to set index ownership
Next
From: "Nicolas Addington"
Date:
Subject: BUG #1381: invalid input syntax for integer: ""