Re: [HACKERS] Indixing problems...

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: vadim(at)krs(dot)ru (Vadim Mikheev)
Cc: daveh(at)insightdist(dot)com, Bill(dot)Allie(at)mug(dot)org, hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Indixing problems...
Date: 1998-09-09 04:25:30
Message-ID: 199809090425.AAA03598@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> David Hartwig wrote:
> >
> > This is the same problem as that has been pestering me for two weeks.
> >
> > Billy, please try this simple test:
> >
> > CREATE TABLE foo (bar int);
> >
> > \d foo
> >
> > CREATE INDEX foo_idx ON foo USING btree (bar);
> >
> > \d foo
> >
> > Is foo gone?
>
> Please apply this patch...
>
> Vadim

> *** src/backend/catalog/index.c.orig Wed Sep 9 11:14:40 1998
> --- src/backend/catalog/index.c Wed Sep 9 11:15:50 1998
> ***************
> *** 1424,1433 ****
>
> newtup = heap_modifytuple(tuple, pg_class, values, nulls, replace);
> heap_replace(pg_class, &tuple->t_ctid, newtup);
> - pfree(newtup);
> CatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, idescs);
> CatalogIndexInsert(idescs, Num_pg_class_indices, pg_class, newtup);
> CatalogCloseIndices(Num_pg_class_indices, idescs);
> }
>
> if (!IsBootstrapProcessingMode())
> --- 1424,1433 ----
>
> newtup = heap_modifytuple(tuple, pg_class, values, nulls, replace);
> heap_replace(pg_class, &tuple->t_ctid, newtup);
> CatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, idescs);
> CatalogIndexInsert(idescs, Num_pg_class_indices, pg_class, newtup);
> CatalogCloseIndices(Num_pg_class_indices, idescs);
> + pfree(newtup);
> }
>
> if (!IsBootstrapProcessingMode())

Wow, this is GREAT. Vadim saves me AGAIN.

I did write this code as part of the megpatch, because tuple allocations
where not being properly de-allocated.

This clearly is a bug, and hopefully it will be the fix I have been
looking for. I was supposed to get on David Hartwig's AIX machine
tomorrow, so if this fixes all our problems, we can move on to more
productive items.

Again, sorry to have introduced this bug into the code, and thanks again
to Vadim for finding it.

--
Bruce Momjian | 830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us | Drexel Hill, Pennsylvania 19026
+ If your life is a hard drive, | (610) 353-9879(w)
+ Christ can be your backup. | (610) 853-3000(h)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas G. Lockhart 1998-09-09 06:07:52 Re: [HACKERS] Indixing problems...
Previous Message Tatsuo Ishii 1998-09-09 04:05:46 Re: [HACKERS] Indixing problems...