Re: pg_dump fails to set index ownership

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: pg_dump fails to set index ownership
Date: 2005-01-11 05:25:31
Message-ID: 12526.1105421131@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Michael Fuhr <mike(at)fuhr(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Nicolas Addington 2005-01-11 05:28:30 BUG #1381: invalid input syntax for integer: ""
Previous Message Michael Fuhr 2005-01-11 03:43:17 Re: pg_dump fails to set index ownership