X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id BD5CC9F9EF3 for ; Thu, 8 Jun 2006 12:17:09 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 65144-06 for ; Thu, 8 Jun 2006 12:17:00 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 194739FA5C8 for ; Thu, 8 Jun 2006 12:16:59 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 27CAC56453; Thu, 8 Jun 2006 10:16:59 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Thu, 8 Jun 2006 10:16:58 -0500 Date: Thu, 8 Jun 2006 10:16:57 -0500 From: "Jim C. Nasby" To: soni de Cc: pgsql-performance@postgresql.org Subject: Re: Regarding pg_dump utility Message-ID: <20060608151657.GL45331@pervasive.com> References: <9f2e40a90606072309v4c5b2623k8bda2614cd575835@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9f2e40a90606072309v4c5b2623k8bda2614cd575835@mail.gmail.com> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060608:soni.de@gmail.com::ns9X695JcQitVlRm:00000000000000000000 0000000000000000000000004X9a X-Hashcash: 1:20:060608:pgsql-performance@postgresql.org::IHJ1fZ97dCSPRV9o:00000 0000000000000000000000007hTo X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/88 X-Sequence-Number: 19445 On Thu, Jun 08, 2006 at 11:39:48AM +0530, soni de wrote: > We have to take a backup of database and we know the pg_dump utility of > postgresql. > > But may I know, is there any API for this pg_dump utility so that we can > call it from the C program? Or only script support is possible for this. It probably wouldn't be terribly difficult to put the guts of pg_dump into a library that you could interface with via C. I'm not sure if the community would accept such a patch; though, I seem to recall other people asking for this on occasion. > I think script support is bit risky because if anything goes wrong while > taking backup using pg_dump then user will not understand the problem of > falling > > If only script support is possible then what should we prefer perl or shell? Depends on what you're trying to accomplish. Perl is a much more capable language than shell, obviously. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461