X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id D11A7D1D099; Mon, 19 Apr 2004 17:21:56 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 95443-05; Mon, 19 Apr 2004 17:21:56 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 4D5CBD1D08B; Mon, 19 Apr 2004 17:21:54 -0300 (ADT) Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) by mail1.ihs.com (8.12.10/8.12.10) with ESMTP id i3JKJiu9019960; Mon, 19 Apr 2004 14:19:48 -0600 (MDT) Date: Mon, 19 Apr 2004 14:17:48 -0600 (MDT) From: "scott.marlowe" To: Cc: , Subject: Re: [SQL] SQL script In-Reply-To: <20040415082206.DB1A939834A@ws5-1.us4.outblaze.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IHS-MailScanner: Found to be clean X-IHS-MailScanner-SpamCheck: X-IHS-MailScanner-Envelope-Sender: scott.marlowe@ihs.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/637 X-Sequence-Number: 59879 On Thu, 15 Apr 2004 vickr1z@operamail.com wrote: > good day toall.. > imm running postgreSQL on linux. > my main goal is to create a script that will dump a data from our server too my local PC. the content of the script would be execute sql command in one shot: > 1. dump data > 2. update and insert some rows to selected table. > > how can i accommplish this task and also how can i run this script? is there any one ccan help me. any idea will appreciate very much. Just FYI, this might get better response on the admin mailing list... So, what is your local PC running? Linux, BSD, Solaris, Windows? If NOT windows, then just install a copy of postgresql on it real quick to get access to the pg_dump utilities et. al. and use that to remotely dump the data out of the server onto your local machine. Are you updating / inserting back into the big server, or locally? either way, the easiest way I've found to do it is to use a scripting language I'm familiar with (perl, PHP, python, tcl, etc...) and massage the data in whatever ways you need to and then insert it into the database with that scripting languages pg interface package. Other ways of doing it would be to get it into a SQL dump format and use psql to insert it.