X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 133D9D1B8B7 for ; Fri, 5 Sep 2003 15:18:20 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 45482-09 for ; Fri, 5 Sep 2003 12:18:09 -0300 (ADT) Received: from lorax.kciLink.com (lorax.kciLink.com [206.112.95.1]) by svr1.postgresql.org (Postfix) with ESMTP id 649F7D1B89D for ; Fri, 5 Sep 2003 12:18:09 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by lorax.kciLink.com (Postfix) with ESMTP id 0C2B33E3A for ; Fri, 5 Sep 2003 11:18:09 -0400 (EDT) Received: from lorax.kciLink.com ([127.0.0.1]) by localhost (lorax.kciLink.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 67291-04-5 for ; Fri, 5 Sep 2003 11:17:58 -0400 (EDT) Received: from lorax.kciLink.com (localhost [127.0.0.1]) by lorax.kciLink.com (Postfix) with ESMTP id 4F19B3E28 for ; Fri, 5 Sep 2003 11:17:58 -0400 (EDT) Received: (from news@localhost) by lorax.kciLink.com (8.12.8p1/8.12.8/Submit) id h85FHw5M080644 for pgsql-general@postgresql.org; Fri, 5 Sep 2003 11:17:58 -0400 (EDT) To: pgsql-general@postgresql.org Path: not-for-mail From: Vivek Khera Newsgroups: ml.postgres.general Subject: Re: Backup? Date: Fri, 05 Sep 2003 11:17:58 -0400 Organization: Khera Communications, Inc., Rockville, MD Lines: 37 Message-ID: References: <1062703912.28376.31.camel@pennywise.havleik.no> <1062714209.17023.143.camel@haggis> NNTP-Posting-Host: yertle.kcilink.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: lorax.kciLink.com 1062775078 90206 216.194.193.105 (5 Sep 2003 15:17:58 GMT) X-Complaints-To: daemon@kciLink.com NNTP-Posting-Date: Fri, 5 Sep 2003 15:17:58 +0000 (UTC) User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Portable Code, berkeley-unix) Cancel-Lock: sha1:GZUf+2Gt+p6x/pXliMuO1pSA1Nc= X-Virus-Scanned: by amavisd-new at kciLink.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/454 X-Sequence-Number: 48676 >>>>> "RJ" == Ron Johnson writes: RJ> On Thu, 2003-09-04 at 15:40, Doug McNaught wrote: >> Bjørn T Johansen writes: >> >> > Should one use pg_dumpall to backup the database or is it more practical >> > to just copy the data directory? >> >> The data directory will not be consistent unless the server is >> stopped. pg_dumpall works well, produces a consistent backup and is >> easily portable to a different machine architecture if need be. RJ> And it's smaller than the data/ directory, especially when "-F c" RJ> option is used. That and indexes are represented as a single "CREATE INDEX" statement, rather than possibly gigabytes of data ;-) I had one index which I just realized was redundant to another and deleting it saved me ~1Gb on disk. For the curious, the indexes were like this: PRIMARY KEY (a,b); INDEX a ON mytable (a); The query planner shows slightly longer plans with just the PK, but the cost savings on mass inserts which happen often offset this immensely, not to mention 1Gb of disk which never needs to be read into the buffers ;-) -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D. Khera Communications, Inc. Internet: khera@kciLink.com Rockville, MD +1-240-453-8497 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/