From: Scott Marlowe <scott.marlowe@gmail.com>
To: Suresh Gupta VG <suresh.g@zensar.com>
Cc: Peter Koczan <pjkoczan@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Postgresql takes more time to update
Date: Tue, 23 Oct 2007 15:47:12 -0500
Message-ID: <dcc563d10710231347h45b183fbk911b77bfd0181bdd@mail.gmail.com> (raw)
In-Reply-To: <3D5445983859B84B92669C0D883EA6FB0AC8BA74@ZENMAILHQ1.ind.zensar.com>
References: <AcgJyJzrClCumlTWS1GJyq3c82yFzwLlBgIg>
<3D5445983859B84B92669C0D883EA6FB0AC8BA74@ZENMAILHQ1.ind.zensar.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: scott.marlowe@gmail.com, suresh.g@zensar.com, pjkoczan@gmail.com
Subject: Re: Postgresql takes more time to update
In-Reply-To: <dcc563d10710231347h45b183fbk911b77bfd0181bdd@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox