Subject: killing process while creating index, and more...

From: John Peter Lee <[email-masked]>
Date: Tue, 23 Nov 1993 15:16:14 -0500 (EST)

Hi:

  I would like to know what the effect would be if I had killed my process
  that was building indexes on a newly created database. It seems that the
  b-tree building is taking an extremely long time, and I'd like to stop
  for now and do some other work with the database. If I killed the 
  process and deleted the index (can I do that, or only delete classes ?),
  would all be well ??? Would anything become corrupted such that the 
  database is unreadable ??? It took over 25 hours to construct the data-
  base, and I don't want to make it unusable.

  Also, I never heard back from yesterday's question concerning the 
  potential memory leak in Postgres. I had to use PQreset every 9000
  appends to clear out the resident set of the postgres process. Any
  news on this ?

  thanks,

  jp

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JP Lee               Institute for Visualization and Perception Research	
[email-masked]                    University of Massachusetts at Lowell 
(508) 934-3384			      1 University Ave. Lowell, MA 01854

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---

From: [email-masked] (Paul M. Aoki)
Date: Tue, 23 Nov 93 13:47:22 -0800

>   base, and I don't want to make it unusable.

the short answer is, yes, you *can* corrupt your database by doing a 
kill -9 of a backend that's building an index.  specifically, it is
possible (not certain) that you may damage the indexes on the system 
catalogs (which are modified because you're creating a new index 
classes), making the whole database unusable (albeit recoverable with 
some effort).  i don't remember whether 4.0.1 had catalog indexes or 
not, but i certainly would not do that on 4.1.

mind you, it might work.  however, even if you got lucky, the 
transaction would not have committed and the index would not be visible 
to the database, so you would have to clean up the appropriate files 
by hand.

in any case, there is no mechanism for restarting an interrupted 
index build.

>   appends to clear out the resident set of the postgres process. Any

i hate to say this but -- there is a workaround so this is unlikely 
to be looked at anytime soon.  (if someone here [ucb] has spare cycles, 
feel free to volunteer.)
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  [email-masked]
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki