Re: [HACKERS] Open 6.5 items

Поиск
Список
Период
Сортировка
От Ole Gjerde
Тема Re: [HACKERS] Open 6.5 items
Дата
Msg-id Pine.LNX.4.05.9905170011260.26745-100000@snowman.icebox.org
обсуждение исходный текст
Ответ на Open 6.5 items  (Bruce Momjian <maillist@candle.pha.pa.us>)
Ответы Re: [HACKERS] Open 6.5 items  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список pgsql-hackers
On Sun, 16 May 1999, Bruce Momjian wrote:
> nodeResults.c and parse_clause.c give compiler warnings

No warnings on Redhat Linux 6.0 (Linux 2.2.7, egcs 1.1.2, glibc 2.1)

> DROP TABLE leaves INDEX file descriptor open

Shouldn't now.. index_destroy() gets called, which again calls smgrunlink.
It looks like smgrunlink closes all fds.

> DROP TABLE/RENAME TABLE doesn't remove extended files, *.1, *.2

This now works(with the patch from yesterday).

> Vacuum of tables >2 gigs - NOTICE:  Can't truncate multi-segments relation

This is actually more of a fundamental problem with mdtruncate.  It looks
like someone just didn't add support for multiple segments for truncation.

The following patch seems to do the right thing, for me at least.
It passed my tests, my data looks right(no data that shouldn't be in
there) and regression is ok.

Ole Gjerde

--- src/backend/storage/smgr/md.c    1999/04/05 22:25:11    1.42
+++ src/backend/storage/smgr/md.c    1999/05/17 06:23:23
@@ -711,15 +711,26 @@    MdfdVec    *v;#ifndef LET_OS_MANAGE_FILESIZE
-    int            curnblk;
+    int            curnblk,
+                    i,
+                    oldsegno,
+                    newsegno;
+    char        fname[NAMEDATALEN];
+    char        tname[NAMEDATALEN + 10];    curnblk = mdnblocks(reln);
-    if (curnblk / RELSEG_SIZE > 0)
-    {
-        elog(NOTICE, "Can't truncate multi-segments relation %s",
-             reln->rd_rel->relname.data);
-        return curnblk;
-    }
+    oldsegno = curnblk / RELSEG_SIZE;
+    newsegno = nblocks / RELSEG_SIZE;
+
+    StrNCpy(fname, RelationGetRelationName(reln)->data, NAMEDATALEN);
+
+    if (newsegno < oldsegno) {
+        for (i = (newsegno + 1);; i++) {
+            sprintf(tname, "%s.%d", fname, i);
+            if (FileNameUnlink(tname) < 0)
+                break;
+        }
+        }#endif    fd = RelationGetFile(reln);



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Oleg Bartunov
Дата:
Сообщение: Re: [HACKERS] GEQO optimizer (was Re: Backend message type 0x44 arrived while idle)
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Open 6.5 items