Re: Fix for OWNER TO breaking ACLs - Mailing list pgsql-patches

From Christopher Kings-Lynne
Subject Re: Fix for OWNER TO breaking ACLs
Date
Msg-id 410DB791.1010706@familyhealth.com.au
Whole thread Raw
In response to Re: Fix for OWNER TO breaking ACLs  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Fix for OWNER TO breaking ACLs
List pgsql-patches
> * You had consistently changed the simple_heap_update calls to do the
> wrong thing.  (I'm surprised it didn't blow up on you in your testing.)
> In a sequence like
>
>         newtuple = heap_modifytuple(tup, rel, repl_val, repl_null, repl_repl);
>
>         simple_heap_update(rel, &newtuple->t_self, newtuple);
>         CatalogUpdateIndexes(rel, newtuple);
>
> the second parameter to simple_heap_update *must* be newtuple->t_self
> not tup->t_self.  The reason is that simple_heap_update stores the new
> physical location of the updated tuple back into that parameter, and
> then the CatalogUpdateIndexes call relies on newtuple->t_self to
> generate new index entries.  The way you had it coded, it was generating
> new index entries pointing at the old version of the tuple ...

Strange.  I guess I must have been testing with a database that had
short enough system catalogs that the indexes were never used?

Chris


pgsql-patches by date:

Previous
From: Christopher Kings-Lynne
Date:
Subject: Re: fix schema ownership on first connection preliminary
Next
From: Zhenbang Wei
Date:
Subject: Traditional Chinese postgres-zh_TW.po for 7.5