On Thu, Mar 26, 2015 at 1:02 AM, Fabrízio de Royes Mello <fabriziomello@gmail.com> wrote: > On Wed, Mar 25, 2015 at 12:46 PM, Fabrízio de Royes Mello > <fabriziomello@gmail.com> wrote: >> >> >> On Wed, Mar 25, 2015 at 10:53 AM, Andres Freund <andres@2ndquadrant.com> >> wrote: >> > >> >> > Did you check whether a similar bug was made in other places of >> > 85b506bb? Could you additionally add a regression test to this end? >> > Seems like something worth testing. >> > >> >> I'm checking it and adding some regression tests. >> > > I didn't found any other similar bug introduced by 85b506bb. > > Attached the original patch provided by Michael with some regression tests.
Thanks for adding a test, this looks fine to me (did some sanity checks and tutti-quanti for people wondering). On temporary tables this was failing with an error in md.c...
Thanks to both of you for fixing this.
I still, however, have a problem with the separate and original issue of:
# insert into utest (thing) values ('moomoo'); ERROR: index "utest_pkey" contains unexpected zero page at block 0 HINT: Please REINDEX it.
I don't see why the user should need to go re-indexing all unlogged tables each time a standby is promoted. The index should just be empty and ready to use.