From 2132e062e1732d4a8b975cbbce3beb7e083b7979 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sat, 15 May 1999 22:31:07 +0000 Subject: [PATCH] I made it so it rolled over files at 1MB. My table ended up with 120 segments, and my indexes had 3(Yes, it DOES work!). DROP TABLE removed ALL segments from the table, but only the main index segment. So it looks like removing the table itself is using mdunlink in md.c, while removing indexes uses FileNameUnlink() which only unlinks 1 file. As far as I can tell, calling FileNameUnlink() and mdunlink() is basically the same, except mdunlink() deletes any extra segments. I've done some testing and it seems to work. It also passes regression tests(except float8, geometry and rules, but that's normal). If this patch is right, this fixes all known multi-segment problems on Linux. Ole Gjerde --- src/backend/catalog/index.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 4acc7c3631..0754455103 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.71 1999/05/10 00:44:55 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.72 1999/05/15 22:31:07 momjian Exp $ * * * INTERFACE ROUTINES @@ -1187,7 +1187,7 @@ index_destroy(Oid indexId) */ ReleaseRelationBuffers(userindexRelation); - if (FileNameUnlink(relpath(userindexRelation->rd_rel->relname.data)) < 0) + if (mdunlink(userindexRelation) != SM_SUCCESS) elog(ERROR, "amdestroyr: unlink: %m"); index_close(userindexRelation); -- 2.40.0