X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 0F4E39DCAD9 for ; Thu, 8 Dec 2005 03:55:06 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 97401-09 for ; Thu, 8 Dec 2005 03:55:06 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id DE88B9DCA95 for ; Thu, 8 Dec 2005 03:55:03 -0400 (AST) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id jB87t0mI078028 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 8 Dec 2005 00:55:03 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.4/8.13.4) with ESMTP id jB87t0Th023644; Thu, 8 Dec 2005 00:55:00 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.4/8.13.4/Submit) id jB87t0wQ023628; Thu, 8 Dec 2005 00:55:00 -0700 (MST) (envelope-from mfuhr) Date: Thu, 8 Dec 2005 00:55:00 -0700 From: Michael Fuhr To: Benjamin Arai Cc: pgsql-admin@postgresql.org Subject: Re: Backing up views, functions Message-ID: <20051208075500.GA12878@winnie.fuhr.org> References: <4397D871.20208@cs.ucr.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4397D871.20208@cs.ucr.edu> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.043 required=5 tests=[AWL=0.043] X-Spam-Score: 0.043 X-Spam-Level: X-Archive-Number: 200512/59 X-Sequence-Number: 19779 On Wed, Dec 07, 2005 at 10:53:37PM -0800, Benjamin Arai wrote: > I have a database of several million records and we are currently > developing pl functions and views. How do you dump only the code for > views and functions? pg_dump doesn't allow you to be that selective, but you could use the --schema-only option to dump everything except the data. If you use one of the non-text dump formats then you could selectively restore objects with pg_restore. See the pg_restore documentation for the -l/--list and -L/--use-list options and the example near the bottom of the page. Some people maintain the code for functions and views outside the database, perhaps under a version control system, and then reload it when they make changes. -- Michael Fuhr