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 D30329FA4D8 for ; Thu, 8 Jun 2006 13:23:37 -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 76025-02 for ; Thu, 8 Jun 2006 13:23:29 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from alvh.no-ip.org (201-221-200-231.bk11-dsl.surnet.cl [201.221.200.231]) by postgresql.org (Postfix) with ESMTP id 237269FA1A4 for ; Thu, 8 Jun 2006 13:23:29 -0300 (ADT) Received: by alvh.no-ip.org (Postfix, from userid 1000) id EF1C3C3A216; Thu, 8 Jun 2006 12:23:27 -0400 (CLT) Date: Thu, 8 Jun 2006 12:23:27 -0400 From: Alvaro Herrera To: "Jim C. Nasby" Cc: soni de , pgsql-performance@postgresql.org Subject: Re: Regarding pg_dump utility Message-ID: <20060608162327.GD17421@surnet.cl> Mail-Followup-To: "Jim C. Nasby" , soni de , pgsql-performance@postgresql.org References: <9f2e40a90606072309v4c5b2623k8bda2614cd575835@mail.gmail.com> <20060608151657.GL45331@pervasive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060608151657.GL45331@pervasive.com> User-Agent: Mutt/1.5.11+cvs20060403 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.162 tagged_above=0 required=5 tests=AWL, BAYES_00, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, FORGED_RCVD_HELO, RCVD_IN_SORBS_DUL X-Spam-Level: X-Archive-Number: 200606/92 X-Sequence-Number: 19449 Jim C. Nasby wrote: > 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. Personally I think it would be neat. For example the admin-tool guys would be able to get a dump without invoking an external program. Second it would really be independent of core releases (other than being tied to the output format.) pg_dump would be just a simple caller of such a library, and anyone else would be able to get dumps easily, in whatever format. -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support