Re: Proposal : REINDEX SCHEMA - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Proposal : REINDEX SCHEMA
Date
Msg-id CAB7nPqQW1XYqFvkodsok7nCb5rwMPS4n14UbqTQcgGHxeT9ifQ@mail.gmail.com
Whole thread Raw
In response to Re: Proposal : REINDEX SCHEMA  (Sawada Masahiko <sawada.mshk@gmail.com>)
Responses Re: Proposal : REINDEX SCHEMA  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On Mon, Dec 1, 2014 at 11:29 PM, Sawada Masahiko <sawada.mshk@gmail.com> wrote:
> On Thu, Nov 27, 2014 at 11:43 PM, Michael Paquier
> <michael.paquier@gmail.com> wrote:
>> If you get that done, I'll have an extra look at it and then let's
>> have a committer look at it.
>
> Attached patch is latest version.
> I added new enum values like REINDEX_OBJECT_XXX,
> and changed ReindexObject() function.
> Also ACL problem is fixed for this version.

Thanks for the updated version.
I have been looking at this patch more deeply, and I noticed a couple
of things that were missing or mishandled:
- The patch completely ignored that a catalog schema could be reindexed
- When reindexing pg_catalog as a schema, it is critical to reindex
pg_class first as reindex_relation updates pg_class.
- gram.y generated some warnings because ReindexObjectType stuff was
casted as ObjectType.
- There was a memory leak, the scan keys palloc'd  in ReindexObject
were not pfree'd
- Using do_user, do_system and now do_database was really confusing
and reduced code lisibility. I reworked it using the object kind
- The patch to support SCHEMA in reindexdb has been forgotten.
Reattaching it here.
Adding on top of that a couple of things cleaned up, like docs and
typos, and I got the patch attached. Let's have a committer have a
look a it now, I am marking that as "Ready for Committer".
Regards,
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: 9.5: Better memory accounting, towards memory-bounded HashAgg
Next
From: Michael Paquier
Date:
Subject: Re: New Event Trigger: table_rewrite