Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id CD7469FC06A for ; Tue, 23 Oct 2007 17:47:21 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 30855-08 for ; Tue, 23 Oct 2007 17:47:11 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by postgresql.org (Postfix) with ESMTP id 0A4FE9FBEE6 for ; Tue, 23 Oct 2007 17:47:13 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id j3so198642ugf for ; Tue, 23 Oct 2007 13:47:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=TdiEyAb+lQ9ov4nDv1fy0UpKrEvMn9zk0YthlzQ+8BA=; b=bBDUxphJgLujq9Y/2VYx0xEIe3UvPbytc83YYv/0awVGxxJDrT0of+ewGPW3HSD2crml3uEa7fktEzdtQp+CBI+K9cMO0Xb0WijQMbTSPz2fzqKxTnpXySm/IwuJCwDtC4NELroGxqGqNlA/kxNxqEoxGfrYUSWW2cAhjGKAxYY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=ZLjiZ0gMvkL5m8WTcLzt5cdvjFkQqRuNneENzhYImSrNczp04JAW6RZbr/N7NihRAQIq+HrIH1/EaA2+s/CC+Pf6J0RBX8NlPHuosmN7jPA1UePqbhIOZEbMZQoz9joVRlmr3E/77+Zvtb4HcL+1KHumt5nhmYhgkrYh10h/Efo= Received: by 10.66.220.17 with SMTP id s17mr1271390ugg.1193172432248; Tue, 23 Oct 2007 13:47:12 -0700 (PDT) Received: by 10.67.40.10 with HTTP; Tue, 23 Oct 2007 13:47:12 -0700 (PDT) Message-ID: Date: Tue, 23 Oct 2007 15:47:12 -0500 From: "Scott Marlowe" To: "Suresh Gupta VG" Subject: Re: Postgresql takes more time to update Cc: "Peter Koczan" , pgsql-admin@postgresql.org In-Reply-To: <3D5445983859B84B92669C0D883EA6FB0AC8BA74@ZENMAILHQ1.ind.zensar.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3799_9771774.1193172432238" References: <3D5445983859B84B92669C0D883EA6FB0AC8BA74@ZENMAILHQ1.ind.zensar.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/227 X-Sequence-Number: 27141 ------=_Part_3799_9771774.1193172432238 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/23/07, Suresh Gupta VG wrote: > > Hi Peter, > > > > 1) We are using "psql 7.4.2" version of Postgresql, need to create a > new schema similar to the current schema with all the objects as in the > current schema. Do we have any command to support this operation? > > 2) We need to shift all the data between 2 different databases in 2 > different servers. What is the best way to go either backup or copy command? > > > 3) Any equivalent command to export and import commands in > Oracle/SQL. > > > > Can you please give some knowledge on this > 1: Upgrade to 7.4.18 (or whatever the latest is) as soon as you can. Use pg_dump with the -s switch to get just the schema and objects but no data out. pg_dump --help will give you a list of all the options that command has. To put your new schema into another database, just redirect that file to psql: pg_dump -s -h olddbserver olddbname > schemafile.sql psql -h newserver newdbname < svhemafile.sql 2: pg_dump is the best way to go. pg_dumpall can dump everything, including user accounts from one server. Then feed the output to psql or pg_restore. 3: pg_dump is export, psql or pg_restore are import ------=_Part_3799_9771774.1193172432238 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/23/07, Suresh Gupta VG <suresh.g@zensar.com> wrote:

Hi Peter,

 

1)       We are using "psql 7.4.2" version of Postgresql, need to create a new schema similar to the current schema with all the objects as in the current schema. Do we have any command to support this operation?

2)       We need to shift all the data between 2 different databases in 2 different servers. What is the best way to go either backup or copy command?

3)       Any equivalent command to export and import commands in Oracle/SQL.

 

Can you please give some knowledge on this

1:  Upgrade to 7.4.18 (or whatever the latest is) as soon as you can.  Use pg_dump with the -s switch to get just the schema and objects but no data out.  pg_dump --help will give you a list of all the options that command has.  To put your new schema into another database, just redirect that file to psql:

pg_dump -s -h olddbserver olddbname > schemafile.sql
psql -h newserver newdbname < svhemafile.sql

2: pg_dump is the best way to go.  pg_dumpall can dump everything, including user accounts from one server.  Then feed the output to psql or pg_restore.

3: pg_dump is export, psql or pg_restore are import
------=_Part_3799_9771774.1193172432238--