agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
From: Paul M. Aoki <aoki@postgres.Berkeley.EDU>
To: shlam@ie.cuhk.hk
Cc: postgres@postgres.Berkeley.EDU
Subject: Re: how to clean up pg_log, pg_time and pg_variable?
Date: Mon, 06 Jun 94 19:21:15 -0700
Message-ID: <199406070221.TAA14287@faerie.CS.Berkeley.EDU> (raw)
In-Reply-To: <9406070209.AA21554@eng.ie.cuhk.hk>

shlam@ie.cuhk.hk writes:
> Then I want to do what is the consequence if I accidentally delete these files?

any tuples that have not been processed by the "vacuum" command become
invisible/"uncommitted", as if they had been rolled back.

the reason is that until the vacuum cleaner processes a newly-
inserted tuple, the system has to consult pg_time and pg_log to see
if/when its transaction committed.  if a tuple has not been vacuumed
*and* there is no commit info (because the files were deleted) then
the system assumes the transaction aborted and that the tuple should
be ignored.

an anonymous hacker points out that if you are super-crafty you can
replace log/time pages that correspond to transactions for which *all*
tuples in *all* databases are guaranteed to have been vacuumed with
zero-filled pages (i.e., create a file with "holes," like those
created by dbm) since these do not take up actual file system space.
this is a nifty, tricky way to do the truncation i was talking about
before.  we don't currently have a tool to do this.
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  aoki@postgres.Berkeley.EDU
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU"

   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================



reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: postgres@postgres.berkeley.edu
  Cc: aoki@postgres.Berkeley.EDU, shlam@ie.cuhk.hk
  Subject: Re: how to clean up pg_log, pg_time and pg_variable?
  In-Reply-To: <199406070221.TAA14287@faerie.CS.Berkeley.EDU>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox